diff --git a/src/app/app.rs b/src/app/app.rs index a4928b3..c223eee 100644 --- a/src/app/app.rs +++ b/src/app/app.rs @@ -109,6 +109,7 @@ impl App { if let Some(action) = event_to_action(&key_event) { match action { Action::Quit => self.exit = true, + Action::Quit2 => self.exit = true, Action::Esc => self.view = View::MainMenu, _ => (), } diff --git a/src/app/keybindings/keybindings.rs b/src/app/keybindings/keybindings.rs index f23fdfe..075faca 100644 --- a/src/app/keybindings/keybindings.rs +++ b/src/app/keybindings/keybindings.rs @@ -4,6 +4,7 @@ use ratatui::crossterm::event::{KeyCode, KeyEvent, KeyEventKind, KeyModifiers}; #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub enum Action { Quit, + Quit2, Up, Down, Space, @@ -50,6 +51,15 @@ pub static KEYBINDINGS: &[KeyBinding] = &[ symbol: "q", description: "Quit", }, + KeyBinding { + action: Action::Quit2, + code: KeyCode::Char('c'), + kind: KeyEventKind::Press, + modifiers: KeyModifiers::CONTROL, + group: Group::Quit, + symbol: "Ctrl + c", + description: "Quit", + }, KeyBinding { action: Action::Up, code: KeyCode::Up, @@ -106,9 +116,11 @@ pub fn binding_for_view(view: View) -> Vec<&'static KeyBinding> { binding_for(Action::Down).unwrap(), binding_for(Action::Space).unwrap(), binding_for(Action::Quit).unwrap(), + binding_for(Action::Quit2).unwrap(), ], _ => vec![ binding_for(Action::Quit).unwrap(), + binding_for(Action::Quit2).unwrap(), binding_for(Action::Esc).unwrap(), ], } diff --git a/src/app/keybindings/main_menu.rs b/src/app/keybindings/main_menu.rs index 3fd8a8f..b6f7c05 100644 --- a/src/app/keybindings/main_menu.rs +++ b/src/app/keybindings/main_menu.rs @@ -8,6 +8,7 @@ pub fn main_menu_keybindings(app: &mut App, event: &KeyEvent) { if let Some(action) = event_to_action(&event) { match action { Action::Quit => app.exit = true, + Action::Quit2 => app.exit = true, Action::Up => { app.game_states.main_menu_state.selected_view = app .game_states