pub fn intent_from_key(
key: &KeyInput,
pane: &str,
target: &str,
field: &str,
tick: u64,
) -> Option<Expr>Expand description
Reduces a key event to a validated Intent for pane/target at tick.
field names the focused field key within target’s resource; an
intent/edit-field is scoped to that field path so a keystroke edits one
field rather than overwriting the whole resource at the root path []. When
field is empty there is no focused field to bind to, so KeyInput::Char
yields None instead of clobbering the root value.
Returns None for keys with no Intent mapping (currently KeyInput::Backspace),
for a KeyInput::Char with no focused field, and, defensively, for any
event that fails to form a valid Intent. The mappings are:
KeyInput::Enter->intent/invokeactivating the focused target.KeyInput::Up/KeyInput::Down->intent/selectof the target.KeyInput::Left/KeyInput::Right->intent/moveof the target node.KeyInput::Char->intent/edit-fieldtyping into the focusedfield.KeyInput::Colon->intent/invokecarrying the command string.KeyInput::Escape->intent/cancelof the pane.