createKeyboardShortcut
createKeyboardShortcut<
TKeyboardEvent>(definition):KeyboardShortcut<TKeyboardEvent>
Defined in: keyboard-shortcuts.ts:86
Creates a KeyboardShortcut from a KeyboardShortcutDefinition.
default keyboard event definitions are required while the apple
keyboard event definitions are optional.
Type Parameters
Section titled “Type Parameters”TKeyboardEvent
Section titled “TKeyboardEvent”TKeyboardEvent extends Pick<KeyboardEvent, "key" | "code" | "altKey" | "ctrlKey" | "metaKey" | "shiftKey"> = Pick<KeyboardEvent, "key" | "code" | "altKey" | "ctrlKey" | "metaKey" | "shiftKey">
Parameters
Section titled “Parameters”definition
Section titled “definition”Returns
Section titled “Returns”KeyboardShortcut<TKeyboardEvent>
Example
Section titled “Example”const shortcut = createKeyboardShortcut({ default: [{ key: 'B', alt: false, ctrl: true, meta: false, shift: false, }], apple: [{ key: 'B', alt: false, ctrl: false, meta: true, shift: false, }],})