React Data Grid ShortcutManager

Description

The ShortcutManager API lets you store and manage keyboard shortcut contexts (ShortcutContext).

Each ShortcutManager object:

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.

releasePressedKeys

Source code (opens new window)

shortcutManager.releasePressedKeys() : function

Release every previously pressed key.

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
Last update: Apr 3, 2024