AltGr characters fire unmodified hotkeys on the same physical key
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 84/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- frontend
Direzione di ricerca
Inizia in _match.ts: leggi modifiersMatch (righe 86-87 che azzerano Ctrl/Alt sotto altGraph), il controllo sulle lettere latine alla riga 53, il fallback di code alle righe 60-64 e il percorso diretto tramite key alla riga 30, che gestisce già gli hotkey con Ctrl/Alt. Decidi in quale punto un carattere prodotto da AltGr debba saltare il fallback sulla tastiera fisica, quindi esegui la suite di test del package più i tre casi di riproduzione dell'issue (tutti e tre devono restituire false). Per completare si intende che le pressioni di AltGr non corrispondono più, mentre i test esistenti di hotkey-matching continuano a passare.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 738
- Fork
- 48
- Merge medio
- 4h 4m
- PR unite (30g)
- 14
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di TanStack/hotkeys
-
ignoreInput isn't detected across realmsForse già presa @wojtowicz-artur l’ha presa 88 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
TanStack/hotkeys#105 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
`useKeyHold` / `KeyStateTracker` latches a modifier forever when a `keyup` is swallowed without a `blur` (e.g. macOS Cmd+Shift+4)Forse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 50/100
TanStack/hotkeys#143 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
'Space'-shortcut overrides native behavior triggering focused elementsForse già presa @KevinVandy l’ha presa 17 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 56/100
TanStack/hotkeys#142 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
TanStack/hotkeys#138 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di TanStack/hotkeys
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
AvaProtocol/ava-sdk-js#276 ·
I maintainer di solito rispondono entro 1 giorno
-
useFragment does not require `variables` when the fragment's variables type has required fieldsAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
apollographql/apollo-client#13493 ·
I maintainer di solito rispondono entro 1 giorno
-
Custom hosts written as trailing-dot FQDNs (`host.local.`) aren't detected as local backendsForse già presa @roboomp l’ha presa oggi. Apertabug prio:p2 providers triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
can1357/oh-my-pi#15798 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
code-yeongyu/oh-my-openagent#10172 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
PDFCraftTool/pdfcraft#189 ·