https://bugs.winehq.org/show_bug.cgi?id=53958
Bug ID: 53958 Summary: X11DRV_InitKeyboard() assigns wrong scancodes on uncommon X11 keyboard layouts Product: Wine Version: 7.21 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: winex11.drv Assignee: wine-bugs@winehq.org Reporter: doucha@swarmtech.cz Distribution: ---
Created attachment 73541 --> https://bugs.winehq.org/attachment.cgi?id=73541 Patch with fallback scancode mapping
I use a custom X11 keyboard layout which maps non-ASCII characters to the top row of alphanumeric keys. This causes the X11DRV_InitKeyboard() heuristics to fail and the number keys get high scancodes (0x60+) which are generally unsupported by Windows software. This causes issues mainly in games.
For example in Gothic 1, the number keys are used to switch between melee weapon, bow and magic. In one of the main quests, you need to cast a spell. But on my machine the keys for selecting spells have wrong scancodes in WINE and Gothic doesn't allow them to be remapped. This means that the game cannot be completed.
Here's a patch that'll fix the wrong scancodes by mapping X11 keysyms to US QWERTY layout.