[BUG] Clipboard Paste inserts nothing in Flutter macOS apps (synthetic Cmd+V lacks the left-Command device flag)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- flutter, swift
- Domain
- accessibility, desktop
Research direction
Read PasteDeliveryCoordinator.swift, especially SystemPasteCommandPoster.makePasteEvents(), and verify how it creates and posts the synthetic Cmd+V events. Reproduce with a focused Flutter macOS TextField using Clipboard Paste, comparing the current flags with the proposed left-Command device flag. Done when dictated text is inserted and delivery no longer reports success when nothing was pasted.
Written by the indexing model from the issue text.
Description
Describe the bug
With Text insertion set to "Clipboard Paste (Recommended)", dictated text never reaches text fields in Flutter macOS apps, while FluidVoice logs the delivery as successful (outcome=inserted).
Cause: SystemPasteCommandPoster.makePasteEvents() in PasteDeliveryCoordinator.swift sets the flags of the synthetic Command and V events to .maskCommand only (0x100000). A physical Cmd+V also carries the device-dependent bit that tells which Command key is down (NX_DEVICELCMDKEYMASK, 0x8). Flutter's macOS embedder tracks modifier state from these device-dependent bits only (synchronizeModifiers in FlutterEmbedderKeyResponder.mm, kModifierFlagMetaLeft = 0x8 in KeyCodeMap_Internal.h). Flutter therefore sees a plain V with no Command key held, its Cmd+V shortcut never fires, and nothing is pasted.
Proposed fix, in makePasteEvents():
let commandFlags: CGEventFlags = [.maskCommand, CGEventFlags(rawValue: UInt64(NX_DEVICELCMDKEYMASK))]
cmdDown.flags = commandFlags
vDown.flags = commandFlags
vUp.flags = commandFlags
The left bit matches the key that is actually posted (kVK_Command). Spoken send with Cmd+Enter (SpokenSendKey.commandEnter.eventFlags is .maskCommand) probably has the same problem in Flutter apps. I have not tested it.
Reproduction steps
-
Create a minimal Flutter macOS app (Flutter 3.47.7 stable here) with
flutter create --platforms=macos repro, then replacerepro/lib/main.dartwith:import 'package:flutter/material.dart'; void main() => runApp( const MaterialApp(home: Scaffold(body: TextField(autofocus: true))), ); -
Run it with
flutter run -d macosand leave the text field focused. -
In FluidVoice, set Text insertion to "Clipboard Paste (Recommended)" and dictate a sentence.
-
The field stays empty.
To isolate the cause, I replayed the exact four events from makePasteEvents() against that app (same flags, posted to .cghidEventTap, same temporary pasteboard item, clipboard restored after 500 ms):
- flags as in FluidVoice (
0x100000): nothing is inserted; - same events with
0x8added (0x100008): the text is pasted.
Expected behavior
The dictated text is inserted into the focused Flutter text field, as with a physical Cmd+V.
Actual behavior
Nothing is inserted, and FluidVoice logs the delivery as successful (outcome=inserted). Switching Text insertion to "Direct Paste" works around it.
App Version
1.6.11
macOS Version
macOS 27.0.1
Architecture
Apple Silicon
- Dominant language
- Swift
- Stars
- 11.9k
- Forks
- 863
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 29
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from altic-dev/FluidVoice
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
altic-dev/FluidVoice#1175 · 1 comment ·
Maintainers usually reply within 1 day
-
[BUG] File transcription skips audio chunks shorter than one secondPossibly taken @sabbah13 claimed this 4 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
altic-dev/FluidVoice#1161 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
altic-dev/FluidVoice#1187 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 48/100
altic-dev/FluidVoice#1184 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
altic-dev/FluidVoice#1180 · 1 comment ·
Maintainers usually reply within 1 day
All issues in altic-dev/FluidVoice
Similar issues
-
area/kotlin
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
cable-report
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
darrylmorley/whatcable#656 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
omlahore/RemoveMacAI#67 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
521xueweihan/HelloGitHub#4049 ·
-
enhancement UI
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day