CreateShortcutManager
Members
activeContextName
createShortcutManager~activeContextName : string
The name of the active ShortcutContext.
CONTEXTS
createShortcutManager~CONTEXTS : UniqueMap
A unique map that stores keyboard shortcut contexts.
isCtrlKeySilenced
createShortcutManager~isCtrlKeySilenced : boolean
This variable relates to the captureCtrl shortcut option,
which allows for capturing the state of the Control/Meta modifier key.
Some of the default keyboard shortcuts related to cell selection need this feature for working properly.
Methods
handleEventWithScope
createShortcutManager~handleEventWithScope(event) ⇒ boolean
Handle the event with the scope of the active context.
| Param | Type | Description |
|---|---|---|
| event | KeyboardEvent | The keyboard event. |
recorderCallback
createShortcutManager~recorderCallback(event, keys, context) ⇒ boolean
A callback function for listening events from the recorder.
A context may declare a fallback, so that the keys it does not answer keep working while it is
active - an overlay that covers the grid without replacing it, for example. The chain is walked
here rather than inside the context, which keeps hasShortcut() and getShortcuts() answering
for a single context, as their documentation promises and as hasEventShortcut() needs.
The walk moves on only when NOTHING in the current context ran. A shortcut whose runOnlyIf
returned true stops it, whether or not its callback did anything - that is what lets a context
claim a key deliberately. A shortcut that is registered but declines (its runOnlyIf returned
false) does not shadow the fallback’s answer for the same key, which is the whole point of
inheriting rather than listing keys by hand.
| Param | Type | Description |
|---|---|---|
| event | KeyboardEvent | The keyboard event. |
| keys | Array<string> | Names of the shortcut’s keys, (coming from KeyboardEvent.key), in lowercase or uppercase, unified across browsers. |
| context | object string | The context object or name. |
runContextShortcuts
createShortcutManager~runContextShortcuts(event, keys, context) ⇒ Object
Runs every shortcut the given context registers for the pressed keys, without consulting its fallback.
| Param | Type | Description |
|---|---|---|
| event | KeyboardEvent | The keyboard event. |
| keys | Array<string> | Normalized pressed keys. |
| context | object | The context to run. |
runGlobalScopedShortcuts
createShortcutManager~runGlobalScopedShortcuts(event, keys) ⇒ boolean
Runs shortcuts registered on scope: 'global' contexts when the table shortcut pipeline is blocked.
| Param | Type | Description |
|---|---|---|
| event | KeyboardEvent | The keyboard event. |
| keys | Array<string> | Normalized pressed keys. |
Returns: boolean - Whether a shortcut canceled further handling.