The error callback for recoverable errors such as multiple shortcuts matching, no shortcut matching once a chord chain has been "started", or an unknown key event because no matching key was found (only for keyboard events).
Usually you will want to clear the manager's chain when this happens and display the error to the user. The default callback logs the error and clears the chain.
In the case of multiple valid shortcuts, if you trigger any of the shortcuts "manually" note that you will need to simulate both the keydown/keyup calls if you differentiate between them.
Also the input event can be undefined if you set the manager chain directly since it will check if it should trigger shortcuts.
Determines if two conditions are equal.
This is actually not a good idea to implement if you use boolean conditions. See ConditionComparer for why.
Enable/disable listeners. Listeners will remain attached but do nothing.
Enable/disable triggering of shortcuts. The manager otherwise works as normal.
Determines how conditions are evaluated.
Whether to check the state of modifier or toggle keys using event.getModifierState
.
This is set to true by default when using createManager
because it is usually what you want. It tracks the state with the most accuracy when, for example, the user focuses out, toggles a key, then focuses back.
But, if you are allowing the user to change key states in some way (e.g. clicking on keys in the settings to visualize shortcuts), you will want to disable this temporarily so that they can click modifier keys. Otherwise they'd be immediately toggled off again (by the state check during the click) and nothing would happen.
Keys also have their own individual Key.updateStateOnAllEvents in case you need more fine grained control.
When this is set to false, the default mouseenter handler will ignore the event.
If you will always have this set to false, you can forego the mouseenter event listener.
Many methods require some of the manager's options, but not the entire manager. Also it's easier to create a manager from scratch by first creating it's options
This can be used to create the base manager options.