mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-09-15 21:00:42 -07:00
The macOS auto-paste sequence in `send_paste` posted the Cmd-down CGEvent with flags = 0, setting the Command flag only on the V events. On real hardware the Cmd keyDown (a flagsChanged event) already carries kCGEventFlagMaskCommand, and Chromium/Electron builds its tracked modifier state from that flag. With flags = 0 the tracker stays at "Command up", so the following V matches neither the Cmd+V accelerator (tracker says no modifier) nor plain-text insertion (the V event's own flags say Command is held) — Electron drops it silently, producing no paste and no stray "v". AppKit reads the V event's own modifier flags and pastes regardless, which is why native apps (Notes, TextEdit, Warp) worked while Electron targets (Slack, VS Code, VS Code Insiders) silently no-op'd. Setting kCGEventFlagMaskCommand on the Cmd-down event makes the flagsChanged event well-formed; Chromium then registers Command=down and Cmd+V matches. Likely fixes #762 and #643.