Dont forward repeat/release keys to focused window for global hotkeys

This commit is contained in:
dec05eba
2024-12-16 22:07:33 +01:00
parent 014f90cbff
commit 423e710809

View File

@@ -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) {
if(press_status == 1) { /* 1 == Pressed */
puts(global_hotkeys[i].action);
fflush(stdout);
}
return false;
}
}
return true;
}