Fix missed hotkey releases while OpenWispr is active#85
Open
Chipagosfinest wants to merge 1 commit into
Open
Conversation
Chipagosfinest
marked this pull request as ready for review
July 13, 2026 06:33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #86.
Why
OpenWispr currently installs only
NSEvent.addGlobalMonitorForEvents. Per Apple's event-monitor contract, a global monitor observes events dispatched to other applications, not the application that installed it. If OpenWispr is active—for example while its menu is open—a hold-to-talk key-down may be observed globally, while the matching release is delivered locally and missed. The recorder lifecycle then remains in its recording state after the user releases the key.Installing the complementary local monitor closes that event-scope gap. Local events are returned unchanged so normal AppKit handling continues.
This is separate from #83, which recovers recorder state across macOS sleep/wake.
Apple reference: https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/EventOverview/MonitoringEvents/MonitoringEvents.html
User impact
Hold-to-talk recording now stops when the hotkey is released even if OpenWispr becomes the active application during the gesture.
Validation
git diff --checkswift test --filter HotkeyManagerTests— 1 test, 0 failuresswift test— 125 tests, 0 failuresswift build -c releaseScope
Only hotkey event monitoring and its focused regression test changed. Recording, transcription, clipboard insertion, configuration, and menu behavior are otherwise unchanged.