React Data Grid ShortcutManager
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 code (opens new window)shortcutManager.addContext(contextName) ⇒ object
Create a new ShortcutContext
object.
Param | Type | Description |
---|---|---|
contextName | string | The name of the new shortcut context |
destroy
Source code (opens new window)shortcutManager.destroy() : function
Destroy a context manager instance.
getActiveContextName
Source code (opens new window)shortcutManager.getActiveContextName() ⇒ string
Get the ID of the active ShortcutContext
.
getContext
Source code (opens new window)shortcutManager.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 code (opens new window)shortcutManager.isCtrlPressed() ⇒ boolean
Returns whether control
or meta
keys are pressed.
setActiveContextName
Source code (opens new window)shortcutManager.setActiveContextName(contextName)
Start listening to keyboard shortcuts within a given ShortcutContext
.
Param | Type | Description |
---|---|---|
contextName | string | The name of the shortcut context |