Skip to main content

Module shortcut

Module shortcut 

Source
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. command is Mod (⌘ on macOS, Ctrl elsewhere); ctrl is the literal Control key.
ParseError
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); None when 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); None when it is not a shortcut.
parse_list
Parse a list of alternatives (Mod+Y / Mod+Shift+Z). Every alternative must parse.