JavaScript Data GridShortcutManager
Description
The ShortcutManager
API lets you store and manage keyboard shortcut contexts (ShortcutContext
).
Each ShortcutManager
object:
- Stores and manages its own set of keyboard shortcut contexts.
- Listens to the
KeyboardEvent
(opens new window) events and runs actions for them.
Methods
addContext
Source codeshortcutManager.addContext(contextName) ⇒ object
Create a new ShortcutContext
object.
Param | Type | Description |
---|---|---|
contextName | string | The name of the new shortcut context |
destroy
Source codeshortcutManager.destroy() : function
Destroy a context manager instance.
getActiveContextName
Source codeshortcutManager.getActiveContextName() ⇒ string
Get the ID of the active ShortcutContext
.
getContext
Source codeshortcutManager.getContext(contextName) ⇒ object | undefined
Get a keyboard shortcut context by its name.
Param | Type | Description |
---|---|---|
contextName | string | The name of the shortcut context |
Returns: object
| undefined
- A ShortcutContext
object that stores registered shortcuts
isCtrlPressed
Source codeshortcutManager.isCtrlPressed() ⇒ boolean
Returns whether control
or meta
keys are pressed.
releasePressedKeys
Source codeshortcutManager.releasePressedKeys() : function
Release every previously pressed key.
setActiveContextName
Source codeshortcutManager.setActiveContextName(contextName)
Start listening to keyboard shortcuts within a given ShortcutContext
.
Param | Type | Description |
---|---|---|
contextName | string | The name of the shortcut context |