Show / Hide Table of Contents

Class TriggerOptions

Allows to set some options for multiple triggers and their actions.

public class TriggerOptions
Remarks

You set options through a thread-static property ActionTriggers.Options. Changed options are applied to all triggers/actions added afterwards in this thread.

Examples
Triggers.Options.ThreadNew();
Triggers.Options.BeforeAction = o => { opt.key.KeySpeed = 10; };
Triggers.Hotkey["Ctrl+K"] = o => print.it(opt.key.KeySpeed); //10
Triggers.Hotkey["Ctrl+Shift+K"] = o => print.it(opt.key.KeySpeed); //10
Triggers.Options.BeforeAction = o => { opt.key.KeySpeed = 20; };
Triggers.Hotkey["Ctrl+L"] = o => print.it(opt.key.KeySpeed); //20
Triggers.Hotkey["Ctrl+Shift+L"] = o => print.it(opt.key.KeySpeed); //20

Namespace: Au.Triggers
Assembly: Au.dll
Inheritance
object
TriggerOptions

Properties

Name Description
AfterAction

A function to run after the trigger action. For example, it can log exceptions.

BeforeAction

A function to run before the trigger action. For example, it can set opt options.

EnabledAlways

If true, triggers added afterwards don't depend on ActionTriggers.Disabled and ActionTriggers.DisabledEverywhere. This property sets the ActionTrigger.EnabledAlways property of triggers added afterwards.

Methods

Name Description
Reset()

Clears all options.

Thread(int, int, bool)

Run actions always in the same dedicated thread that does not end when actions end.

ThreadNew(bool)

Run trigger actions in new threads.

ThreadOfTriggers()

Run trigger actions in the same thread as ActionTriggers.Run. Dangerous, rarely used.

ThreadPool(bool)

Run trigger actions in thread pool threads.

ThreadThis()

Run trigger actions in this thread (which called this function).