Keyboard input simulation fails; clipboard insertion works
- Dominant language
- Swift
- Stars
- 2.9k
- Forks
- 226
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
Keyboard simulation / non-clipboard insertion does not insert transcribed text into the focused app.
Hex successfully records and transcribes audio. The transcription appears in Hex history, so speech-to-text is working. However, when **Use Clipboard** is disabled, Hex only plays a macOS “ding” sound and does not insert the text into the currently focused text field.
Clipboard insertion works, but I prefer not to use clipboard insertion because I use Maccy as a clipboard manager, and it stores previous voice-to-text outputs in clipboard history.
The relevant log line appears to be:
```text
2026-05-07 13:13:26.745 E Hex[8090:15287] [com.kitlangton.Hex:Pasteboard] Error executing AppleScript typing fallback:
```
Immediately before that, transcription appears to complete successfully:
```text
2026-05-07 13:13:22.259 Df Hex[8090:152a4] [com.kitlangton.Hex:Transcription] Transcribed audio from to text length 10
```
**To Reproduce**
Steps to reproduce the behavior:
1. Open Hex on macOS.
2. Disable **Use Clipboard**.
3. Enable keyboard input simulation / non-clipboard insertion.
4. Focus a text field, such as in TextEdit.
5. Trigger Hex dictation.
6. Speak a short phrase.
7. Wait for transcription to complete.
8. Hex plays a ding sound, the transcription appears in Hex history, but no text is inserted into the focused app.
**Expected behavior**
When **Use Clipboard** is disabled and keyboard input simulation is enabled, Hex should insert the transcribed text into the currently focused app/text field.
**Screenshots**
Not applicable.
**Desktop (please complete the following information):**
- OS: macOS
- Hex version: [please fill in]
- Clipboard insertion: works
- Keyboard simulation / non-clipboard insertion: fails
- Clipboard manager: Maccy
- Karabiner-Elements: installed, but disabling it did not resolve the issue
**Additional context**
Things I already tested:
- Re-granted Accessibility permission multiple times.
- Re-granted Input Monitoring permission multiple times.
- Removed and re-added Hex permissions.
- Disabled Karabiner-Elements completely.
- Restarted Hex after changing permissions.
- Tested with clipboard insertion enabled, which works.
- Confirmed transcription appears in Hex history.
- Tested MacWhisper on the same machine, and MacWhisper is able to insert text without using the clipboard.
This suggests the issue is specific to Hex’s non-clipboard insertion path rather than a general macOS permission problem.
Because MacWhisper can insert text without using the clipboard on the same system, non-clipboard insertion appears to be possible generally. The failure seems specific to Hex’s keyboard simulation / AppleScript typing fallback path.
This matters for privacy-sensitive dictation workflows because clipboard insertion can leak dictated text into clipboard managers such as Maccy.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating Hex’s keyboard simulation and AppleScript typing fallback path, then compare it with the working clipboard insertion path. Reproduce the issue on macOS with a focused TextEdit field and verify that disabling Use Clipboard inserts the completed transcription without the ding or fallback error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- macos, swift
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100