From 124fc8bc5bddd93dedaef00ca8b62b4d9e2fd22c Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 25 Mar 2026 20:40:47 +0000 Subject: [PATCH] Release all modifiers before sending clean Ctrl+grave sequence Use explicit keyup ctrl alt super first, then the exact working sequence: keydown ctrl, key grave, keyup ctrl. https://claude.ai/code/session_01XKYC1basxdwtHy71tky7xm --- openwhispr-ptt.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/openwhispr-ptt.py b/openwhispr-ptt.py index e08b042..c9423ca 100644 --- a/openwhispr-ptt.py +++ b/openwhispr-ptt.py @@ -38,18 +38,17 @@ is_recording = False def send_whispr_toggle(): """Send Ctrl+` to OpenWhispr via xdotool. - We first release Alt (which we're physically holding), send Ctrl+grave, - then re-press Alt. This way OpenWhispr sees clean Ctrl+` without - the Alt modifier corrupting it. + Release all held modifiers first, then send the full + keydown ctrl, key grave, keyup ctrl sequence cleanly. """ try: subprocess.run( - ["xdotool", "keyup", "alt"], + ["xdotool", "keyup", "ctrl", "alt", "super"], timeout=2, capture_output=True, ) subprocess.run( - ["xdotool", "key", WHISPR_HOTKEY], + ["xdotool", "keydown", "ctrl", "key", "grave", "keyup", "ctrl"], timeout=2, capture_output=True, )