Skip to content

Dictation output triggers wrong command on non-QWERTY keyboard layouts (e.g., Dvorak)Β #89

@aYumaIto

Description

@aYumaIto

Describe the bug

When using Amical for dictation on non-QWERTY keyboard layouts like Dvorak, the transcribed text is not pasted into the active application. Instead, an unintended keyboard shortcut (Cmd+K on Dvorak) is triggered.

This happens because the Swift helper uses hardcoded physical key codes to simulate Cmd+V. On Dvorak, the physical key position that corresponds to "V" on QWERTY actually produces "K".

App Version

v0.1.17

Model Information

Any (issue is unrelated to transcription model)

System Information

  • Operating System: macOS (any version)
  • Keyboard Layout: Dvorak (or any layout where 'V' is in a different physical position than QWERTY)

To Reproduce

  1. Set macOS keyboard layout to Dvorak
  2. Open any text editor (e.g., Notes, VS Code, Slack)
  3. Use Amical to dictate some text (hold the dictation shortcut key and speak)
  4. Release the key to complete dictation
  5. Observe that Cmd+K is triggered instead of Cmd+V

Expected behavior

Transcribed text should be pasted into the active application regardless of the user's keyboard layout.

Additional context

The root cause is in the Swift helper:

// packages/native-helpers/swift-helper/Sources/SwiftHelper/utils/Constants.swift
let VK_V: CGKeyCode = 9  // Physical key code for 'V' on US QWERTY

macOS key codes represent physical key positions, not characters:

Key Code Physical Position (US QWERTY) Character on Dvorak
9 V K

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions