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, )