mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-05 16:35:33 +00:00
When a European layout is active, and the user presses AltGr, Windows generates a simulated VK_LCONTROL event alongside the VK_RMENU event. This was causing the OSK to show LCtrl as depressed alongside RAlt, so the OSK would show the wrong modifier layer, which was unhelpful and confusing to the end user. It is possible to detect the simulated VK_LCONTROL in the WH_KEYBOARD_LL hook, because the scan code generated is 0x21D, instead of 0x1D. Warning: this is not a documented value. (But, this 0x21D scan code is not passed to the WM_KEYDOWN event!) Therefore, we use Keyman's existing kmnLowLevelKeyboardProc to pass modifier key events on to the visual keyboard. This patch handles only this specific scenario, by watching for that specific scan code in the new handler in the UfrmOSKOnScreenKeyboard module, together with some minor refactoring so that it fits neatly. A future improvement would be to have all modifier key processing go through this new handler, and eliminate the timer-based polling of the keyboard. However, there is some additional risk around missing events, leading to 'stuck modifiers'. Fixes: #14890 Build-bot: skip release:windows |
||
|---|---|---|
| .. | ||
| charmap | ||
| chromium | ||
| components | ||
| ext | ||
| general | ||
| keyboards | ||
| packages | ||
| setup | ||
| standards | ||
| tlb | ||
| tools | ||
| ui | ||
| vcl | ||
| visualkeyboard | ||
| web | ||
| build.sh | ||