Skip to main content

intent_from_key

Function intent_from_key 

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