Skip to content

input

Functions

  • command_for_key - Converts a key press into a command for the current application state.
  • handle_key - Applies the command represented by a key press.

firma_tui::control::input::command_for_key

Section titled “firma_tui::control::input::command_for_key”

Function

Converts a key press into a command for the current application state.

fn command_for_key(app: & mut crate::control::app::App, key: crossterm::event::KeyCode) -> Option<crate::control::command::ControlCommand>

Function

Applies the command represented by a key press.

Keys that do not map to a command in the current UI context leave the app unchanged and return no effects.

fn handle_key(app: & mut crate::control::app::App, key: crossterm::event::KeyCode) -> Vec<crate::control::command::ControlEffect>