pub fn classify_key(key: &KeyEvent) -> Option<TerminationIntent>Expand description
Classify a key event into a TerminationIntent, if it is one. Pure, dependency-free function
so it’s unit testable without a live terminal/event loop.
- Bare
q/Esc/ barex(no modifiers) ->StopCurrent. - Ctrl+C / Ctrl+X (any other modifiers alongside Control, e.g. Shift from a capital-C keycap,
still match -
containsrather than exact equality) ->QuitAll. - Anything else (including Space, and
q/xwith unrelated modifiers) ->None.