From 6991fdbbee135d608144ebdb9457bbdae3abc4f8 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 25 Mar 2026 20:37:05 +0000 Subject: [PATCH] Fix Ctrl+grave being sent without Ctrl due to --clearmodifiers --clearmodifiers releases ALL modifiers including Ctrl, so xdotool sends bare grave (types 'v'). Instead, explicitly release only Alt before sending Ctrl+grave so OpenWhispr receives the correct combo. https://claude.ai/code/session_01XKYC1basxdwtHy71tky7xm --- openwhispr-ptt.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/openwhispr-ptt.py b/openwhispr-ptt.py index 0ec52dc..e08b042 100644 --- a/openwhispr-ptt.py +++ b/openwhispr-ptt.py @@ -38,12 +38,18 @@ is_recording = False def send_whispr_toggle(): """Send Ctrl+` to OpenWhispr via xdotool. - Uses --clearmodifiers to release any physically held keys first, - so the simulated Ctrl+` isn't mangled into Ctrl+Alt+`. + 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. """ try: subprocess.run( - ["xdotool", "key", "--clearmodifiers", WHISPR_HOTKEY], + ["xdotool", "keyup", "alt"], + timeout=2, + capture_output=True, + ) + subprocess.run( + ["xdotool", "key", WHISPR_HOTKEY], timeout=2, capture_output=True, )