Expand description
Portable keyboard shortcuts.
One syntax everywhere: Mod+Shift+S, where Mod is ⌘ on macOS and Ctrl elsewhere. Ctrl is the
literal Control key (⌃ on macOS; the same key as Mod elsewhere). Legacy spellings are
accepted: Cmd+Z, Command+Z, CmdOrCtrl+Z, Option+X, glyphs (⌘⇧S). Several shortcuts for
one command are separated by / (Mod+Y / Mod+Shift+Z).
Chord is the UI-independent key chord; the UI layer maps its key events onto it.
Structs§
- Chord
- One key chord: modifiers plus a key.
- Mods
- Modifier keys.
commandisMod(⌘ on macOS, Ctrl elsewhere);ctrlis the literal Control key. - Parse
Error - Text that is not a shortcut.
Enums§
- Key
- The key of a chord.
- Named
- Keys with a name rather than a character.
- Platform
- The platform shortcuts are shown and matched for.
Functions§
- display
- A shortcut text as shown on
platform(Mod+Shift+S→⌘⇧S);Nonewhen it is not a shortcut. - display_
list - Display form of a list for
platform. - format_
list - Portable form of a list:
Mod+Y / Mod+Shift+Z. - normalize
- A shortcut text in canonical portable form (
cmd+shift+s→Mod+Shift+S);Nonewhen it is not a shortcut. - parse_
list - Parse a list of alternatives (
Mod+Y / Mod+Shift+Z). Every alternative must parse.