This page covers a next version of Handsontable, and is not published yet.

This page covers a non-latest version of Handsontable.

# 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.

# 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 Updated: Nov 20, 2024