Expand description
Re-export shim for the chord primitives.
K.2.1 (2026-06-01) relocated the canonical definitions of
KeyChord / KeyKind / KeyMods / SpecialKey /
ChordPattern (and the chord parser / formatter) into
lattice-protocol, so any crate at the dependency floor
can construct chord values without depending on
lattice-host. The host’s own keymap matcher
(KeymapTrie / KeymapLayer / BoundCommand) still lives
here; only the wire data moved.
This shim preserves the existing
lattice_host::chord::{...} import paths used by the
TUI / GPUI adapters and the host internals. Plan to retire
the shim once downstream re-imports flip to
lattice_protocol::chord::*.
Structs§
- KeyChord
- Canonical, stack-allocated representation of one chord.
- KeyMods
- Modifier bitfield.
Copy + Eq + Hashso the wholeKeyChordfits in a CPU register.
Enums§
- Chord
Parse Error - Parse-side error variants. Detail-level so
:bind-style error messages can surface what was wrong. - Chord
Pattern - One element of a keymap registration path.
- KeyKind
- What kind of key the chord represents.
- Special
Key - Named special keys. Renderer-neutral; crossterm’s
KeyCode::BackTabis normalised away by the TUI adapter (from_crossterm) intoSpecial(Tab) + KeyMods::SHIFTso the trie has one entry for “shift-tab” rather than two ambiguous ones.
Functions§
- last_
chord_ token_ byte_ len - Number of bytes the last chord token occupies at the end of
text, treating it as a sequence of chord tokens (one chord per logical keypress). Used by chord-capture’s backspace handler to remove a whole token instead of a single char. - parse_
chord_ sequence - Parse a chord-sequence string into the canonical
Vec<KeyChord>the keymap trie indexes by. - special_
label - Canonical name for a
SpecialKey. Round-trips throughparse_special. Renderer-neutral text; both the TUI’sformat_chordand any future GPUI describe-key renderer use this label.