From 423e7108091533497baa15d0be7df9442bd67db6 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 16 Dec 2024 22:07:33 +0100 Subject: Dont forward repeat/release keys to focused window for global hotkeys --- tools/gsr-global-hotkeys/main.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'tools/gsr-global-hotkeys') 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; } -- cgit v1.2.3