Use ctrl as mod key for debugging purposes

This commit is contained in:
Victor Timofei 2021-12-11 14:14:50 +02:00
parent 145c0bc2df
commit 44b8a88de6
Signed by: vtimofei
GPG Key ID: B790DCEBE281403A
1 changed files with 7 additions and 8 deletions

View File

@ -526,9 +526,8 @@ enum KeyAction {
} }
fn process_keyboard_shortcut(modifiers: ModifiersState, keysym: Keysym) -> Option<KeyAction> { fn process_keyboard_shortcut(modifiers: ModifiersState, keysym: Keysym) -> Option<KeyAction> {
if modifiers.ctrl && modifiers.alt && keysym == xkb::KEY_BackSpace let modkey = modifiers.ctrl;
|| modifiers.logo && keysym == xkb::KEY_q if modkey && keysym == xkb::KEY_q {
{
// ctrl+alt+backspace = quit // ctrl+alt+backspace = quit
// logo + q = quit // logo + q = quit
Some(KeyAction::Quit) Some(KeyAction::Quit)
@ -537,14 +536,14 @@ fn process_keyboard_shortcut(modifiers: ModifiersState, keysym: Keysym) -> Optio
Some(KeyAction::VtSwitch( Some(KeyAction::VtSwitch(
(keysym - xkb::KEY_XF86Switch_VT_1 + 1) as i32, (keysym - xkb::KEY_XF86Switch_VT_1 + 1) as i32,
)) ))
} else if modifiers.logo && keysym == xkb::KEY_Return { } else if modkey && keysym == xkb::KEY_Return {
// run terminal // run terminal
Some(KeyAction::Run("weston-terminal".into())) Some(KeyAction::Run("alacritty".into()))
} else if modifiers.logo && keysym >= xkb::KEY_1 && keysym <= xkb::KEY_9 { } else if modkey && keysym >= xkb::KEY_1 && keysym <= xkb::KEY_9 {
Some(KeyAction::Screen((keysym - xkb::KEY_1) as usize)) Some(KeyAction::Screen((keysym - xkb::KEY_1) as usize))
} else if modifiers.logo && modifiers.shift && keysym == xkb::KEY_M { } else if modkey && modifiers.shift && keysym == xkb::KEY_M {
Some(KeyAction::ScaleDown) Some(KeyAction::ScaleDown)
} else if modifiers.logo && modifiers.shift && keysym == xkb::KEY_P { } else if modkey && modifiers.shift && keysym == xkb::KEY_P {
Some(KeyAction::ScaleUp) Some(KeyAction::ScaleUp)
} else { } else {
None None