Repository navigation
🐛 fix(keymap): punctuation shortcuts by US position on non-Latin layouts (#131) - #138
Merged
Merged
Conversation
A capture-phase window listener learns the layout's script from plain letter presses (KeyA–KeyZ without Shift, Alt, AltGr or Meta; Ctrl counts). When the last letter typed is not Latin (Russian, Hebrew, Greek…), keyPressOf skips the typed-punctuation steps and names keys by US position again: Ctrl+/ is the "/" keycap, Hebrew brackets are not swapped. On Latin layouts the #105 rule stays, minus the letter-position name for plain ASCII (Dvorak's "'" key and QWERTZ Ctrl+AltGr+Q are no Ctrl+Q). The recorder reads the same state. Refs #131 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…DME, manual check) Refs #131 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Without it Hebrew's "'" key (KeyW) had no name in the Latin state, so Ctrl+W did nothing at startup or right after a switch from a Latin layout. Dvorak's "'" key and QWERTZ Ctrl+AltGr+Q read as Ctrl+Q again (cosmetic). New sweep: every default has a key on every layout in the Latin startup state, no letter typed. Refs #131 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Refs #131 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #131
Summary
Since #105, the matcher names a punctuation key by the character it types. That is right for AZERTY, QWERTZ and Dvorak. On non-Latin layouts (Russian, Hebrew, Greek), though, keycaps carry US legends, and browsers and GTK match punctuation shortcuts by US position. This PR restores that on non-Latin layouts.
installLayoutTrackerinsrc/lib/shortcuts.ts):\p{Script=Latin}switches to the non-Latin state. Turkish ı and ß stay Latin.useShortcut, and recorder cases.src/test/setup.tsresets the tracker after each test.AZERTY behaviour is unchanged. No Rust change.
How it was tested
Manual check list (GNOME, with Russian, Hebrew and French AZERTY input sources; Super+Space to switch)
Checklist
pnpm testgreenpnpm lintgreen (tsc; no Rust change, clippy in CI)pnpm test:rustgreen (not applicable: nosrc-tauri/change)src/lib/strings.ts<emoji> <type>(<scope>): <description>🤖 Generated with Claude Code