From fa5b7a0c751c8d8e37a173df09b7b28733f8df5e Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 5 Jan 2025 03:22:38 +0100 Subject: =?UTF-8?q?Only=20grab=20left=20alt,=20to=20allow=20altgr+z=20to?= =?UTF-8?q?=20be=20used=20for=20keyboard=20that=20type=20=C5=BC=20with=20i?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/gsr-global-hotkeys/keyboard_event.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'tools/gsr-global-hotkeys/keyboard_event.c') diff --git a/tools/gsr-global-hotkeys/keyboard_event.c b/tools/gsr-global-hotkeys/keyboard_event.c index 79e7f17..203dc00 100644 --- a/tools/gsr-global-hotkeys/keyboard_event.c +++ b/tools/gsr-global-hotkeys/keyboard_event.c @@ -165,7 +165,8 @@ static void keyboard_event_process_input_event_data(keyboard_event *self, event_ default: { const bool shift_pressed = self->lshift_button_state == KEYBOARD_BUTTON_PRESSED || self->rshift_button_state == KEYBOARD_BUTTON_PRESSED; const bool ctrl_pressed = self->lctrl_button_state == KEYBOARD_BUTTON_PRESSED || self->rctrl_button_state == KEYBOARD_BUTTON_PRESSED; - const bool alt_pressed = self->lalt_button_state == KEYBOARD_BUTTON_PRESSED || self->ralt_button_state == KEYBOARD_BUTTON_PRESSED; + const bool lalt_pressed = self->lalt_button_state == KEYBOARD_BUTTON_PRESSED; + const bool ralt_pressed = self->ralt_button_state == KEYBOARD_BUTTON_PRESSED; const bool meta_pressed = self->lmeta_button_state == KEYBOARD_BUTTON_PRESSED || self->rmeta_button_state == KEYBOARD_BUTTON_PRESSED; //fprintf(stderr, "pressed key: %d, state: %d, shift: %s, ctrl: %s, alt: %s, meta: %s\n", event.code, event.value, // shift_pressed ? "yes" : "no", ctrl_pressed ? "yes" : "no", alt_pressed ? "yes" : "no", meta_pressed ? "yes" : "no"); @@ -174,8 +175,10 @@ static void keyboard_event_process_input_event_data(keyboard_event *self, event_ modifiers |= KEYBOARD_MODKEY_SHIFT; if(ctrl_pressed) modifiers |= KEYBOARD_MODKEY_CTRL; - if(alt_pressed) - modifiers |= KEYBOARD_MODKEY_ALT; + if(lalt_pressed) + modifiers |= KEYBOARD_MODKEY_LALT; + if(ralt_pressed) + modifiers |= KEYBOARD_MODKEY_RALT; if(meta_pressed) modifiers |= KEYBOARD_MODKEY_SUPER; -- cgit v1.2.3