aboutsummaryrefslogtreecommitdiff
path: root/tools/gsr-global-hotkeys/keyboard_event.c
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2025-03-30 22:31:26 +0200
committerdec05eba <dec05eba@protonmail.com>2025-03-30 22:31:26 +0200
commitc8eadbc7c47f4cecde1588fab3900e9c1e0c7867 (patch)
tree3636c1199e7b664ff4dc189add14395088941449 /tools/gsr-global-hotkeys/keyboard_event.c
parentc7080e5d99bf77e432e6c900e64489b78a233f28 (diff)
m
Diffstat (limited to 'tools/gsr-global-hotkeys/keyboard_event.c')
-rw-r--r--tools/gsr-global-hotkeys/keyboard_event.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/tools/gsr-global-hotkeys/keyboard_event.c b/tools/gsr-global-hotkeys/keyboard_event.c
index c2bd75a..9a92b56 100644
--- a/tools/gsr-global-hotkeys/keyboard_event.c
+++ b/tools/gsr-global-hotkeys/keyboard_event.c
@@ -120,14 +120,13 @@ static void keyboard_event_process_key_state_change(keyboard_event *self, const
/* Return true if a global hotkey is assigned to the key combination */
static bool keyboard_event_on_key_pressed(keyboard_event *self, const struct input_event *event, uint32_t modifiers) {
- if(event->value != KEYBOARD_BUTTON_PRESSED)
- return false;
-
bool global_hotkey_match = false;
for(int i = 0; i < self->num_global_hotkeys; ++i) {
if(event->code == self->global_hotkeys[i].key && modifiers == self->global_hotkeys[i].modifiers) {
- puts(self->global_hotkeys[i].action);
- fflush(stdout);
+ if(event->value == KEYBOARD_BUTTON_PRESSED) {
+ puts(self->global_hotkeys[i].action);
+ fflush(stdout);
+ }
global_hotkey_match = true;
}
}