AltGr characters fire unmodified hotkeys on the same physical key
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 84/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- frontend
Research direction
Start in _match.ts: read modifiersMatch (lines 86-87 clearing Ctrl/Alt under altGraph), the Latin-letter guard at line 53, the code fallback at lines 60-64, and the direct-key path at line 30 that already handles Ctrl/Alt hotkeys. Decide where an AltGr-produced character should skip the physical-key fallback, then run the package test suite plus the three repro cases from the issue (they should all return false). Done means AltGr presses no longer match while existing hotkey-matching tests still pass.
Written by the indexing model from the issue text.
Description
Describe the bug
On layouts with AltGr (German, Polish, …), typing an AltGr character fires an unmodified single-key hotkey on the same physical key.
- German AltGr+M types
µand fires aMhotkey. - Polish AltGr+C types
ćand fires aChotkey. - German AltGr+Q types
@and fires aQhotkey.
In _match.ts, modifiersMatch clears Ctrl and Alt when altGraph is set (lines 86–87). The code fallback (lines 60–64) then maps KeyM → M, which matches. For ć, the Latin-letter guard at line 53 is skipped because normalized.alt is true under AltGr. µ and @ aren't Latin letters, so the guard doesn't apply at all.
Reproduce
import { matchesKeyboardEvent } from '@tanstack/hotkeys'
// What Chrome on Windows reports for AltGr+<key>: Ctrl+Alt plus the AltGraph modifier state.
const altGr = (key: string, code: string) =>
({ type: 'keydown', key, code, ctrlKey: true, altKey: true, shiftKey: false, metaKey: false,
isComposing: false, getModifierState: (k: string) => k === 'AltGraph' }) as unknown as KeyboardEvent
matchesKeyboardEvent(altGr('µ', 'KeyM'), 'M', 'windows') // true, expected false
matchesKeyboardEvent(altGr('ć', 'KeyC'), 'C', 'windows') // true, expected false
matchesKeyboardEvent(altGr('@', 'KeyQ'), 'Q', 'windows') // true, expected false
Expected
A key press that produced a character through AltGr is text input and should not fall back to the physical key. Only a direct key match should count, as line 30 already does for hotkeys with Ctrl/Alt.
Versions
@tanstack/hotkeys 0.11.0 and @tanstack/react-hotkeys 0.13.0. _match.ts on main still has the same code.
- Dominant language
- TypeScript
- Stars
- 738
- Forks
- 48
- Avg merge
- 16h 23m
- Merged PRs (30d)
- 11
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
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 TanStack/hotkeys
-
ignoreInput isn't detected across realmsPossibly taken @wojtowicz-artur claimed this 85 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
TanStack/hotkeys#105 · 2 comments ·
Maintainers usually reply within 1 day
-
`useKeyHold` / `KeyStateTracker` latches a modifier forever when a `keyup` is swallowed without a `blur` (e.g. macOS Cmd+Shift+4)Possibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 4/5 3-5 days Newbie friendliness 50/100
TanStack/hotkeys#143 · 1 reaction ·
Maintainers usually reply within 1 day
-
'Space'-shortcut overrides native behavior triggering focused elementsPossibly taken @KevinVandy claimed this 14 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 56/100
TanStack/hotkeys#142 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
TanStack/hotkeys#138 · 1 comment ·
Maintainers usually reply within 1 day
All issues in TanStack/hotkeys
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
cline/mcp-marketplace#2932 ·
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 82/100
lingdojo/kana-dojo#32188 · 1 comment · 5 reactions ·
Maintainers usually reply within 1 day
-
triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Portkey-AI/gateway#1844 ·
Maintainers usually reply within 1 day
-
needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 61/100
rjsf-team/react-jsonschema-form#5495 ·
Maintainers usually reply within 2 days