You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Hardcoded US-ANSI keycodes break Cmd+V/Cmd+C on Dvorak/Turkish-F layouts, plus KeyInjector vs SelectionCopy clipboard race #341
Sources/BlurtEngine/Injection/KeyInjector+SystemActions.swift:89-96 hardcodes virtualKey: 0x09 (kVK_ANSI_V) and virtualKey: 0x08 (kVK_ANSI_C), whereas Command/VoiceCommandKeys.swift:14-17,43-57 already resolves character shortcuts through KeyboardLayout.current().
Dvorak:0x09 is k and 0x08 is j. Every dictation, rewrite, compose, and voice-command type sends ⌘K instead of ⌘V, and 400 ms later restores the clipboard, silently losing the dictated text.
Turkish-F:0x08 is v and 0x09 is c (swapped). Triggering Read Aloud / Ask in an AX-unreadable app calls postCmdC() which sends ⌘V, pasting clipboard contents into the user's document.
Unsynchronized NSPasteboard.general race between KeyInjector (400 ms pendingSettle) and SelectionCopy
KeyInjector.swift:224-228 returns from insert() immediately while pendingSettle keeps the transcript on NSPasteboard.general for 400 ms.
If the user triggers Read Aloud / Ask / Rewrite in an AX-unreadable app within 400 ms (SelectionCopy.swift:74-105):
If ⌘C lands first: SelectionCopy snapshots the transcript as saved, restores the transcript after reading, and pendingSettle later skips its restore because changeCount moved, permanently overwriting the user's original clipboard.
If pendingSettle fires mid-poll: SelectionCopy sees ownWriteCount != ownWrites and returns early at line 101 without starting restoreLateCopy, letting the in-flight ⌘C permanently overwrite the restored clipboard.
Suggested Fix
Resolve "v" and "c" via KeyboardLayout.current() (with 0x09 / 0x08 fallback).
Serialize KeyInjector (write + ⌘V + settle/restore) and SelectionCopy (snapshot + ⌘C + poll + restore) through a shared clipboard coordinator.
Activity