Appearance
Combo syntax
A combo is a +-separated string of modifiers plus one key:
"mod+s" "mod+shift+k" "alt+enter" "shift+/"Modifiers
| Token | Meaning |
|---|---|
mod | ⌘ on macOS, Ctrl elsewhere — use this one |
meta / cmd / command | the ⌘/Win key literally |
ctrl / control | Control literally |
alt / option / opt | Alt/Option |
shift | Shift |
Prefer mod over cmd/ctrl so one default works on every platform.
Keys
Single characters (a–z, 0–9, punctuation) plus named keys:
enter esc space tab backspace delete up down left rightAliases accepted: return→enter, esc→escape, plus→+, del→delete.
Matching details
- Modifier state must match exactly —
mod+sdoes not fire onmod+shift+s. - When Alt or Shift transform the typed character (e.g. ⌥K →
˚), matching falls back to the physical key code, soalt+kworks as expected. - Shortcuts don't fire while focus is in an input, textarea, select, or contenteditable — unless the shortcut sets
enableOnFormTags: true. - Single chords only for now; sequences (
g d) are on the roadmap.
Display
displayParts(combo) renders platform-appropriate keycaps:
ts
displayParts("mod+shift+k");
// macOS → ["⌘", "⇧", "K"]
// Windows → ["Ctrl", "Shift", "K"]