spiegel-keyman/common/windows
Marc Durdin 50ffbb2722 fix(windows): osk: handle simulated left Control event when AltGr pressed
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
2025-10-08 14:32:40 +02:00
..
cpp chore(windows): Merge branch 'feat/windows/11471/remove-old-flags-modifier' into feat/windows/11471/right-modifier-hk 2024-09-02 11:46:00 +10:00
data maint(common): consolidate builder scripts 2025-08-02 08:11:24 +10:00
delphi fix(windows): osk: handle simulated left Control event when AltGr pressed 2025-10-08 14:32:40 +02:00
.gitignore chore(common): adjust build settings for windows clean builds 2024-08-22 13:20:52 +02:00
build.sh maint(common): consolidate builder scripts 2025-08-02 08:11:24 +10:00
cef-checkout.sh maint(common): consolidate builder scripts 2025-08-02 08:11:24 +10:00
CEF_VERSION.md chore(windows): move cef-checkout.sh to common 2022-06-10 13:23:45 +10:00
mkver.sh maint(common): consolidate builder scripts 2025-08-02 08:11:24 +10:00
signtime.bat chore(windows): move signtime.bat to common 2022-06-10 13:25:29 +10:00