Class KeyBinding

Represents a key combination that can trigger a keyboard shortcut.

Implements

  • KeyCombination

Constructors

Properties

altKey: boolean
controlOrMeta: boolean
ctrlKey: boolean
key: string
metaKey: boolean
shiftKey: undefined | boolean

If undefined, the state of the shift key is ignored.

Methods

  • Returns true if and only if keyEvent should trigger this shortcut.

    Parameters

    • keyEvent: Partial<KeyCombination>

    Returns boolean

  • Accepts a string in the form modifier1+modifier2+...+key (e.g. Ctrl+Shift+a) and returns the corresponding KeyboardShortcut.

    Parameters

    • shortcutStr: string

    Returns KeyBinding

OpenSource licenses