aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-12-16 22:07:33 +0100
committerdec05eba <dec05eba@protonmail.com>2024-12-16 22:07:33 +0100
commit423e7108091533497baa15d0be7df9442bd67db6 (patch)
tree15dc5b2229b860cacf3ca528eeaa9608b94af6b1
parent014f90cbffa69598eca98065a046479d5fd0a0fa (diff)
Dont forward repeat/release keys to focused window for global hotkeys
-rw-r--r--tools/gsr-global-hotkeys/main.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/tools/gsr-global-hotkeys/main.c b/tools/gsr-global-hotkeys/main.c
index 62d34cc..aeea660 100644
--- a/tools/gsr-global-hotkeys/main.c
+++ b/tools/gsr-global-hotkeys/main.c
@@ -25,17 +25,15 @@ static global_hotkey global_hotkeys[NUM_GLOBAL_HOTKEYS] = {
static bool on_key_callback(uint32_t key, uint32_t modifiers, int press_status, void *userdata) {
(void)userdata;
- if(press_status != 1) /* 1 == Pressed */
- return true;
-
for(int i = 0; i < NUM_GLOBAL_HOTKEYS; ++i) {
if(key == global_hotkeys[i].key && modifiers == global_hotkeys[i].modifiers) {
- puts(global_hotkeys[i].action);
- fflush(stdout);
+ if(press_status == 1) { /* 1 == Pressed */
+ puts(global_hotkeys[i].action);
+ fflush(stdout);
+ }
return false;
}
}
-
return true;
}