Skip to content

Hold-to-talk can miss hotkey release while OpenWispr is active #86

Description

@Chipagosfinest

Summary

Hold-to-talk recording can remain active after the hotkey is released when OpenWispr becomes the active application during the key gesture, such as while its menu is open.

Expected behavior

Releasing the configured hold-to-talk hotkey always stops recording, regardless of which application receives the release event.

Root cause

HotkeyManager installs only NSEvent.addGlobalMonitorForEvents. Apple documents that global event monitors observe events dispatched to applications other than the one that installed the monitor. Events delivered to OpenWispr itself require a complementary local monitor.

This creates a split-scope failure: OpenWispr can observe the key-down while another app is active, become active before release, and miss the locally delivered release. Its recording lifecycle then remains active.

Apple reference: https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/EventOverview/MonitoringEvents/MonitoringEvents.html

Scope

This is distinct from #77 / #83, which cover recorder recovery across macOS sleep and wake.

Proposed fix

Install both local and global event monitors, route both through the existing hotkey handler, return local events unchanged, and remove both monitor tokens during cleanup.

Draft implementation: #85

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions