Shortcuts library.
This module holds the registered shortcuts and provides predefined constants for event key codes.
Additionally, you are allowed to register a custom shortcut by using the registerShortcut()
function.
Example on how to register a custom shortcut: jse.libs.shortcuts.registerShortcut('myShortcut', [17, 16, 70], _doThis);
Methods
(static) registerShortcut(name, combination, callback)
Registers a shortcut by adding the key combination and the respective callback function to the register object.
Parameters:
Name | Type | Description |
---|---|---|
name |
String | Name of the key combination. |
combination |
Array.<Number> | Array of event key numbers that represent a key combination. |
callback |
function | Function to be invoked on key combination match. |