Expand description
App-level input dispatch: maps UiEvents into [ViewAction]s.
This module is pure (no I/O, no async, no terminal access). The runtime
loop calls InputMapper::map with a ViewState snapshot plus the
EventResult the focused component
returned for the same event. If the focused component consumed the event,
the mapper defers entirely; otherwise it checks the small closed set of
application keybindings (Ctrl+C / Ctrl+D / Ctrl+Z / Esc / Shift+Tab /
Ctrl+P / Ctrl+L / Ctrl+O / Ctrl+T / Ctrl+G / Ctrl+X / Alt+Enter / Alt+Up)
and emits the matching semantic action.
Double-tap timing for “press Ctrl+C twice within 500ms to exit” and
“press Esc twice within 500ms to open /tree or /fork” lives in
InputState; the runtime owns one instance for the lifetime of the
session and resets it whenever focus moves to or from a selector.
Field and constant names mirror .references/pi/packages/coding-agent/ src/modes/interactive/interactive-mode.ts (key handler block) and
core/keybindings.ts defaults.
Structs§
- Input
Mapper - Pure input mapper.
- Input
State - Mutable state carried across input events for double-tap detection.
Enums§
- Double
Escape Action - What double-Esc on an empty editor should do.
Constants§
- DOUBLE_
TAP_ WINDOW - Default double-tap window for “exit on second tap” semantics.
Functions§
- dismissable_
overlay_ kinds - Re-exported so the runtime can construct the default overlay kind list.
- double_
escape_ action_ from_ str - Helper for tests / settings reload: build a state from the wire string.