Commit 43a35f3
authored
fix(shortcuts): match single-letter hotkeys by layout-aware key
react-hotkeys-hook 4.6.2 matches a hotkey's letter against both the
layout-aware event.key and the physical event.code. For a single-letter
shortcut like "mod+i" (Inbox), that means any key at the physical QWERTY-"I"
position triggers it — so on a Dvorak layout Cmd+C (whose key sits at that
physical slot) navigates to the inbox instead of copying. Every single-letter
mod+<letter> shortcut has the same problem on non-QWERTY layouts.
Patch the library matcher to derive the key from event.key, falling back to
the physical event.code only when a modifier (e.g. macOS Option) turns
event.key into a non-alphanumeric glyph. Special keys (arrows, escape, space)
and Option shortcuts keep working via the fallback.
Generated-By: PostHog Code
Task-Id: 570b6a35-794b-45bb-933f-7b54751b014a1 parent 66bb8b8 commit 43a35f3
4 files changed
Lines changed: 54 additions & 3 deletions
File tree
- packages/ui/src/features/command
- patches
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| 118 | + | |
0 commit comments