ShortcutRegistry class
Class for the registry of keyboard shortcuts. This is intended to be a singleton. You should not create a new instance, and only access this class from ShortcutRegistry.registry.
Signature:
export declare class ShortcutRegistry
Properties
Property | Modifiers | Type | Description |
|---|---|---|---|
|
Methods
Method | Modifiers | Description |
|---|---|---|
Adds a mapping between a keycode and a keyboard shortcut. Normally only one shortcut can be mapped to any given keycode, but setting allowCollisions to true allows a keyboard to be mapped to multiple shortcuts. In that case, when onKeyDown is called with the given keystroke, it will process the mapped shortcuts in reverse order, from the most- to least-recently mapped). | ||
Creates the serialized key code that will be used in the key map. | ||
Gets the serialized key codes that the shortcut with the given name is registered under. | ||
Gets the current key map. | ||
Gets the registry of keyboard shortcuts. | ||
Gets the shortcuts registered to the given key code. | ||
Handles key down events.
| ||
Registers a keyboard shortcut. | ||
Removes all the key mappings for a shortcut with the given name. Useful when changing the default key mappings and the key codes registered to the shortcut are unknown. | ||
Removes a mapping between a keycode and a keyboard shortcut. | ||
Clear and recreate the registry and keyMap. | ||
Sets the key map. Setting the key map will override any default key mappings. | ||
Unregisters a keyboard shortcut registered with the given name. This will also remove any key mappings that reference this shortcut. |