Shortcut
A shortcut is a string in the format 'CommandOrControl+Shift+F'.
Tokens are separated by + and are case-insensitive. The last token must
be a key code; all preceding tokens must be modifiers.
Modifiers
| Token(s) | Description |
|---|---|
CommandOrControl, CmdOrCtrl | Command on macOS, Control on Windows/Linux. |
Command, Cmd, Meta, Super | The Command / Meta key (macOS). |
Control, Ctrl | The Control key. |
Shift | The Shift key. |
Alt, Option | The Alt / Option key. |
AltGr | The AltGr key (Windows/Linux). |
Named key codes
| Token(s) | Description |
|---|---|
Backspace | Backspace key. |
CapsLock | Caps Lock key. |
Delete | Delete key. |
Down, Up, Left, Right | Arrow keys. |
End | End key. |
Enter, Return | Enter / Return key. |
Esc, Escape | Escape key. |
F1–F24 | Function keys. |
Home | Home key. |
Insert | Insert key. |
MediaNextTrack | Media Next Track key. |
MediaPlayPause | Media Play/Pause key. |
MediaPreviousTrack | Media Previous Track key. |
MediaStop | Media Stop key. |
Num0–Num9 | Numpad digit keys. |
NumAdd | Numpad + key. |
NumDec | Numpad decimal key. |
NumDiv | Numpad / key. |
NumLock | Num Lock key. |
NumMult | Numpad * key. |
NumSub | Numpad - key. |
PageDown | Page Down key. |
PageUp | Page Up key. |
Plus | The + key. |
PrintScreen | Print Screen key. |
ScrollLock | Scroll Lock key. |
Space | Space bar. |
Tab | Tab key. |
VolumeDown | Volume Down key. |
VolumeMute | Volume Mute key. |
VolumeUp | Volume Up key. |
Single-character key codes
Any single ASCII character can be used as a key code directly, e.g. A–Z,
0–9, and punctuation such as ,, -, ., /, ;, =, [, \,
], `, and '. Characters that require Shift (e.g. !, @, #,
$, %, ^, &, *, (, ), +, :, <, >, ?, ", {,
|, }, ~, _) implicitly add the Shift modifier.
type Shortcut = string;
Example
‘CommandOrControl+Shift+Z’ ‘Ctrl+Alt+Delete’ ‘F5’ ‘Shift+F’