type Hotkey =
| Key
| SingleModifierHotkey
| TwoModifierHotkey
| ThreeModifierHotkey
| FourModifierHotkey;
Defined in: hotkey.ts:283
A type-safe hotkey string.
Provides autocomplete for:
Use canonical modifier names:
The Mod modifier is a special platform-adaptive modifier that automatically resolves to the "primary modifier" on each platform:
This enables cross-platform hotkey definitions that work correctly on all platforms without platform-specific code. The Mod modifier is resolved at runtime based on the detected platform.
When to use Mod vs platform-specific modifiers:
Limitations:
// Cross-platform shortcuts (recommended)
const save: Hotkey = 'Mod+S' // Command+S on Mac, Ctrl+S on Windows/Linux
const saveAs: Hotkey = 'Mod+Shift+S' // Command+Shift+S on Mac, Ctrl+Shift+S elsewhere
const comment: Hotkey = 'Mod+/' // Command+/ on Mac, Ctrl+/ elsewhere
// Platform-specific shortcuts
const macOnly: Hotkey = 'Meta+S' // Command+S on Mac only
const windowsOnly: Hotkey = 'Control+S' // Ctrl+S on Windows/Linux only