added comment for future implementation
Browse files
+52 −0 src/keyboard/handlers.rs
| @@ -65,3 +65,55 @@ pub fn handle_key_press(event: KeyPressEvent) -> Result<KeyAction> { | ||
| 65 | 65 | }; |
| 66 | 66 | Ok(action) |
| 67 | 67 | } |
| 68 | + | |
| 69 | +// pub struct Key { | |
| 70 | +// pub(crate) modifiers: &'static [KeyButMask], // List of modifiers | |
| 71 | +// pub(crate) key: Keycode, | |
| 72 | +// pub(crate) func: KeyAction, | |
| 73 | +// pub(crate) arg: Arg, | |
| 74 | +// } | |
| 75 | +// | |
| 76 | +// impl Key { | |
| 77 | +// pub const fn new( | |
| 78 | +// modifiers: &'static [KeyButMask], | |
| 79 | +// key: Keycode, | |
| 80 | +// func: KeyAction, | |
| 81 | +// arg: Arg, | |
| 82 | +// ) -> Self { | |
| 83 | +// Self { | |
| 84 | +// modifiers, | |
| 85 | +// key, | |
| 86 | +// func, | |
| 87 | +// arg, | |
| 88 | +// } | |
| 89 | +// } | |
| 90 | +// } | |
| 91 | +// | |
| 92 | +// const KEYBINDINGS: &[Key] = &[ | |
| 93 | +// Key::new( | |
| 94 | +// &[KeyButMask::MOD1], | |
| 95 | +// keycodes::RETURN, | |
| 96 | +// KeyAction::Spawn, | |
| 97 | +// Arg::Str("xclock"), | |
| 98 | +// ), | |
| 99 | +// Key::new( | |
| 100 | +// &[KeyButMask::MOD1, KeyButMask::SHIFT], | |
| 101 | +// keycodes::Q, | |
| 102 | +// KeyAction::KillClient, | |
| 103 | +// Arg::None, | |
| 104 | +// ), | |
| 105 | +// Key::new(&[KeyButMask::MOD1], keycodes::Q, KeyAction::Quit, Arg::None), | |
| 106 | +// Key::new( | |
| 107 | +// &[KeyButMask::MOD1], | |
| 108 | +// keycodes::J, | |
| 109 | +// KeyAction::FocusStack, | |
| 110 | +// Arg::Int(1), | |
| 111 | +// ), | |
| 112 | +// Key::new( | |
| 113 | +// &[KeyButMask::MOD1], | |
| 114 | +// keycodes::K, | |
| 115 | +// KeyAction::FocusStack, | |
| 116 | +// Arg::Int(-1), | |
| 117 | +// ), | |
| 118 | +// ]; | |
| 119 | +// |