spiegel-keyman/common/windows/delphi
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
..
charmap fix(developer): make top row of Character Map 1 pixel to avoid DIV/0 in gestures 2024-05-28 14:25:48 +07:00
chromium chore(developer): final work on build.sh for developer 2024-05-20 06:34:53 +07:00
components maint(common): consolidate builder scripts 2025-08-02 08:11:24 +10:00
ext maint(common): additional builder.inc.sh script renames 2025-08-02 13:16:19 +10:00
general fix(windows): osk: handle simulated left Control event when AltGr pressed 2025-10-08 14:32:40 +02:00
keyboards fix(developer): support &displayMap font in web debugger 2025-01-17 11:03:20 +07:00
packages fix(developer): transform slashes to backslashes in paths in Package Editor 2025-09-10 14:58:13 +02:00
setup fix(developer): show more useful error if out of space during Setup 2022-09-12 12:02:09 +10:00
standards chore(windows): move global/delphi/standards to common 2022-06-13 06:15:47 +10:00
tlb chore(windows): move global/delphi/tlb to common 2022-06-13 06:29:23 +10:00
tools docs(windows): add documentation for localization functions 2025-09-25 09:46:24 +02:00
ui fix(developer): generate a default icon for basic keyboard projects 2022-11-01 15:14:13 +11:00
vcl chore(windows): move Keyman.System.RegExGroupHelperRSP19902 unit to common 2022-06-22 14:02:03 +10:00
visualkeyboard fix(developer): don't include DTD in visual keyboard export 2024-04-26 10:07:01 +07:00
web fix(developer): EncodeURL was not handling spaces 2022-11-26 07:09:53 +07:00
build.sh maint(common): consolidate builder scripts 2025-08-02 08:11:24 +10:00