Expand description
Data-driven, process-global keymap shared by the editor and input line.
Models the VS Code keybindings shape — a chord (1–2 keystrokes) maps to a
Command by name. Generalizes the C++ editor’s firstKeys/quickKeys/
blockKeys tables and key_state prefix machine. See
docs/superpowers/specs/2026-06-12-configurable-keymap-design.md.
Guide: Keyboard & key mapping.
§Turbo Vision heritage
tvision-rs extension: no Turbo Vision counterpart. The C++ editor hard-codes its
keys in the firstKeys / quickKeys / blockKeys tables;
Keymap::word_star transcribes them.
Structs§
- Chord
- A chord: one keystroke, or two for a prefix sequence (Ctrl-K / Ctrl-Q style).
- KeyStroke
- One normalized keystroke: a
Keyplus the three real modifiers. - Keymap
- A
Chord → Commandtable plus the set of strokes that begin a 2-chord.
Enums§
- Resolve
- The outcome of resolving a keystroke against a keymap.
Functions§
- parse_
chord - Parse a VS Code-style chord string: space-separated strokes, each a
+-joined list ofctrl|shift|alt|cmd|metamodifiers ending in a key name. Pure (no I/O).cmd/metaare accepted as aliases forctrl(portability). - resolve_
global - Resolve a stroke against the process-global keymap.
- set_
global - Replace the process-global keymap (the default for all text input).