Skip to main content

Type Alias: HotkeyString

HotkeyString = `${"Mod" | "Ctrl" | "Meta" | "Alt" | "Shift" | "None"}+${Capitalize<string>}`

Defined in: coreUtils/hotkey.ts:20

Represents a keyboard press sequence expression for a hotkey.

The valid hotkey expression is at least one or more modifiers and the key separated by +, e.g. Ctrl+Alt+K, Alt+Meta+Q, Ctrl+/:

  • modifier is one of Mod, Ctrl, Meta, Alt, Shift (Mod is Meta on Mac and Ctrl everywhere else).
  • key is a KeyboardEvent.key with a special case for A-Z keys to handle them independently of an active keyboard layout.
  • single-letter keys are matched case-insensitively, so Ctrl+Shift+a is the same as Ctrl+Shift+A.
  • Shift-specific special keys needs to be specified as-is i.e. Shift+5 will not be triggered and should be specified as Shift+% (and only for keyboard layouts with that mapping).

See

useCanvasHotkey