Skip to main content

handle_key

Function handle_key 

Source
pub fn handle_key(
    key: KeyCode,
    editing_text: bool,
    has_pending_confirmation: bool,
) -> Action
Expand description

Map a key code to an action.

§Arguments

  • key - The key code from a keyboard event
  • editing_text - Whether the user is currently editing text input
  • has_pending_confirmation - Whether there is a pending confirmation dialog

§Returns

The corresponding action for the key, or Action::None if the key is not mapped to any action.