-
Notifications
You must be signed in to change notification settings - Fork 79
API
There are several APIs available when programming a task. They can be used to determined how the task was invoked, so that the task can react accordingly. In addition, there are also APIs to control mouse, keyboard, and other miscellaneous components.
As mentioned in Getting started section, there are several ways to invoke a task. When programming a task with multiple activation methods, it is useful to know how the task was invoked to act accordingly. For example, if a task can be invoked with key chain "A + B" and key chain "A + C", the programming logic could be like the following:
...
if (kc.get(1).k()) == VK_B) {
// Do one thing.
} else {
// Do other thing.
}
The complete KeyStroke class can be found here. The two most important methods are k()
which returns the key being pressed, and m()
which returns the key modifier (either left or right for certain keys like Ctrl or Shift).
The key stroke that invokes the task will be available via KeyChain kc
variable.
This exposes everything in SharedVariables class.
See Shared variables wiki for more details.
This exposes everything in MouseCore.
This exposes everything in KeyboardCore.
Tools is a static library that contains several useful functionalities. The complete API can be found here