Add Quit2 action bound to Ctrl+C

This commit is contained in:
2026-03-12 16:30:54 +01:00
parent c3886ca0cf
commit ef271c0d87
3 changed files with 14 additions and 0 deletions
+12
View File
@@ -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(),
],
}