Repository navigation
XKey v1.2.5
What's New
fix: Support non-QWERTY keyboard layouts (Swiss French, AZERTY, etc.)
Previously, XKey only worked correctly with QWERTY keyboard layouts.
When users had Input Sources like Swiss French (QWERTZ) or French (AZERTY),
Vietnamese typing didn't work because the app was using physical keyCodes
instead of the actual characters from the Input Source.
Root cause:
- KeyboardEventHandler was converting keyCode → character using QWERTY mapping
- This ignored the user's actual Input Source settings
- Example: Swiss French 'z' key (physical Y position) was treated as 'y'
Solution:
- Get character directly from event.characters (respects Input Source)
- Convert character → QWERTY keyCode for engine processing
- Added KeyCodeToCharacter.keyCode(forCharacter:) helper function
Changes:
-
XKey/EventHandling/KeyboardEventHandler.swift:
- Use event.characters instead of KeyCodeToCharacter.qwertyCharacter()
- Convert character → engineKeyCode before passing to VNEngine
- Special keys (arrows, tab, esc, etc.) still use physical keyCode
-
XKey/EventHandling/KeyCodeToCharacter.swift:
- Added keyCode(forCharacter:) function for reverse mapping
- Supports letters, numbers, and special characters
Testing:
- Swiss French (QWERTZ): typing 'thuzj' → 'thụy' ✅
- French (AZERTY): typing works correctly ✅
- US (QWERTY): no change in behavior ✅
- Special keys: arrows, tab, backspace all work ✅