diff --git a/src/run/display/x11.cr b/src/run/display/x11.cr index 2445d1f..d37ac52 100644 --- a/src/run/display/x11.cr +++ b/src/run/display/x11.cr @@ -354,7 +354,11 @@ module Run @mutex.lock @hotkeys.delete hotkey if unsubscribe hotkey.modifier_variants.each do |mod| - @display.ungrab_key(hotkey.keycode, mod, grab_window: from_window) + if hotkey.keysym < 10 + @display.ungrab_button(hotkey.keycode, mod, grab_window: @root_win) + else + @display.ungrab_key(hotkey.keycode, mod, grab_window: from_window) + end end @mutex.unlock @flush_event_queue.send(nil) diff --git a/tests.ahk b/tests.ahk index 18cd4a6..25f3bf9 100755 --- a/tests.ahk +++ b/tests.ahk @@ -3,7 +3,7 @@ ; Right now, only commands that can be easily tested in 1-2 lines are tested. ;;;;;;;;;;;;;;;;;;;;;; -N_TESTS = 55 +N_TESTS = 56 GoSub, run_tests if tests_run != %N_TESTS% @@ -669,6 +669,10 @@ key = xbutton2 xdotool_run = click 9 gosub test_hotkey_success +key = lbUTton +xdotool_run = click 1 +gosub test_hotkey_success + key = a xdotool_run = key a hotkey_send = bcd @@ -685,7 +689,7 @@ hokey_send_raw = ; ;;;;;;;;;; -Send, {LButton} +Send, {LButTon} sleep 50 expect = send {lbutton},gui_button_clicked_success,1 gosub assert