Skip to main content

Function: matchShortcut()

matchShortcut(event, shortcuts?, platform?): ShortcutAction | undefined

Defined in: src/lib/utils/shortcuts/index.ts:557

Find the action for a key press (see comboFromEvent). Modifier keys must match exactly.

Parameters​

event​

KeyEventLike

shortcuts?​

readonly Shortcut[] = SHORTCUTS

platform?​

string

Returns​

ShortcutAction | undefined

Example​

matchShortcut({ key: "Z", metaKey: true, ctrlKey: false, shiftKey: true, altKey: false }, SHORTCUTS, "MacIntel");
// { type: "redo" }