Skip to main content

Module input

Module input 

Source
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§

InputMapper
Pure input mapper.
InputState
Mutable state carried across input events for double-tap detection.

Enums§

DoubleEscapeAction
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.