Skip to content

Keyboard shortcuts fire based on physical key position, breaking non-QWERTY layouts #1797

@charlesvien

Description

@charlesvien

Context

Reported by @haacked in Slack. On a Dvorak keyboard layout, pressing CMD+C (copy) triggers the Inbox shortcut (CMD+I) because the physical QWERTY "I" key maps to "C" in Dvorak. This makes the app unusable for non-QWERTY users since common OS shortcuts collide with app shortcuts.

Problem

We use react-hotkeys-hook v4 which matches shortcuts against event.code (physical key position) rather than event.key (logical/layout-aware character). This means all keyboard shortcuts are bound to QWERTY physical positions regardless of the user's keyboard layout.

Expected behavior

Keyboard shortcuts should respect the user's OS keyboard layout. CMD+I should trigger Inbox based on the logical "I" key, not the physical QWERTY "I" position.

Steps to reproduce

  1. Set macOS keyboard layout to Dvorak (or any non-QWERTY layout)
  2. Select text in the terminal
  3. Press CMD+C (Dvorak) to copy — this hits physical QWERTY "I" key
  4. Inbox opens instead of copying text

Possible solutions

  1. Upgrade to react-hotkeys-hook v5 which adds a useKey: true option to switch to event.key matching. Note: v5 had known bugs with Dvorak/Colemak (issue #1239), partially fixed in v5.2.3.
  2. Implement custom key handling that uses event.key instead of relying on the library's default event.code behavior.

References

  • react-hotkeys-hook#1323 — Library does not support alternate keyboard layouts
  • App version: 0.46.9, macOS arm64, Dvorak layout

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions