spiegel-keyman/common/windows/delphi/general
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
..
BCP47Tag.pas fix(developer): Select BCP47 Code dialog inconsistencies 2023-02-07 12:40:31 +07:00
CleartypeDrawCharacter.pas chore(windows): delete unused MLang.pas 2022-06-21 09:51:02 +10:00
DebugPaths.pas chore(windows): move shared general units to common 2022-06-22 13:58:58 +10:00
DUnitX.Loggers.TeamCity.pas fix(windows): emit nunit report path correctly and update TeamCity links 2025-08-20 07:21:03 +02:00
findfonts.pas chore(windows): move shared general units to common 2022-06-22 13:58:58 +10:00
GetOsVersion.pas chore(windows): move GetOSVersion to common 2022-06-21 09:39:00 +10:00
GlobalProxySettings.pas chore(windows): move shared general units to common 2022-06-22 13:58:58 +10:00
Glossary.pas fix(developer): handle high-bit-set HKL correctly 2022-11-02 17:12:28 +11:00
httpuploader.pas chore(windows): support port in THTTPUploader 2024-05-30 08:20:43 +07:00
httpuploader_messageprocessor_forms.pas chore(windows): move shared general units to common 2022-06-22 13:58:58 +10:00
JsonUtil.pas fix(developer): emit JSON strings as characters, not surrogate pairs 2024-04-18 09:20:40 +07:00
Keyman.System.AndroidStringToKeymanLocaleString.pas chore(windows): move shared general units to common 2022-06-22 13:58:58 +10:00
Keyman.System.CanonicalLanguageCodeUtils.pas chore(windows): move shared general units to common 2022-06-22 13:58:58 +10:00
Keyman.System.ExecutionHistory.pas feat(windows): remove TUpdateStateMachineParams 2024-10-30 16:59:32 +10:00
Keyman.System.KeymanSentryClient.pas chore(windows): move reportExceptions check in exception handler to caller 2023-12-11 20:44:53 +07:00
Keyman.System.LanguageCodeUtils.pas chore(windows): move shared general units to common 2022-06-22 13:58:58 +10:00
Keyman.System.UpdateCheckResponse.pas feat(windows): Online Update check stream update data 2023-11-22 14:23:30 +10:00
KeymanPaths.pas chore: add build.sh edit action for Delphi projects 2025-02-22 06:18:47 +01:00
KeymanVersion.pas chore(windows): move KeymanVersion.pas to common and update refs 2022-06-21 09:39:04 +10:00
keymanversion_build.in maint(common): consolidate builder scripts 2025-08-02 08:11:24 +10:00
KeymanVersionInfo.inc maint(common): consolidate builder scripts 2025-08-02 08:11:24 +10:00
KeyNames.pas chore(windows): move shared general units to common 2022-06-22 13:58:58 +10:00
klog.pas feat(windows): remove klogging enable 2024-08-27 18:03:57 +10:00
MSXMLDomCreate.pas chore(windows): move shared general units to common 2022-06-22 13:58:58 +10:00
RegistryKeys.pas feat(windows): check updates and automatic update merged 2025-02-03 14:25:44 +10:00
ScanCodeMap.pas chore(windows): move RegistryKeys.pas, ErrorControlledRegistry.pas, Glossary.pas, ScanCodeMap.pas to common 2022-06-21 09:39:03 +10:00
StockFileNames.pas chore(windows): fixup refs and move StockFileNames 2022-06-23 09:47:59 +10:00
TempFileManager.pas chore(windows): move shared general units to common 2022-06-22 13:58:58 +10:00
tip_icon_base.rc chore(windows): move utilicon.pas to common 2022-06-22 14:03:19 +10:00
tip_icon_base.res chore(windows): move utilicon.pas to common 2022-06-22 14:03:19 +10:00
ttinfo.pas chore(windows): move shared general units to common 2022-06-22 13:58:58 +10:00
Unicode.pas chore(windows): move Unicode.pas to common 2022-06-21 09:39:01 +10:00
Upload_Settings.pas chore(developer): use kmn.sh instead of deeplink into help.keyman.com for message links 2025-02-07 12:50:38 +07:00
UserMessages.pas fix(windows): osk: handle simulated left Control event when AltGr pressed 2025-10-08 14:32:40 +02:00
usp10.pas chore(windows): move usp10 to common 2022-06-21 09:38:59 +10:00
utildir.pas fix(developer): projects 2.0 internal path enumeration 2023-11-16 11:47:35 +07:00
utilexecute.pas chore(windows): move shared general units to common 2022-06-22 13:58:58 +10:00
utilfiletypes.pas feat(developer): add user interface for kmc copy to TIKE 2025-01-30 11:04:18 +07:00
utilhttp.pas fix(developer): EncodeURL was not handling spaces 2022-11-26 07:09:53 +07:00
utilicon.pas chore(windows): move utilicon.pas to common 2022-06-22 14:03:19 +10:00
utilstr.pas chore(windows): move shared general units to common 2022-06-22 13:58:58 +10:00
utilsystem.pas chore(windows): move shared general units to common 2022-06-22 13:58:58 +10:00
utilxml.pas chore(windows): move shared general units to common 2022-06-22 13:58:58 +10:00
VersionInfo.pas feat(developer): improve compiler messages and user interface 2025-02-07 08:46:46 +07:00
VKeyChars.pas chore(windows): move shared general units to common 2022-06-22 13:58:58 +10:00
VKeys.pas chore(windows): move shared general units to common 2022-06-22 13:58:58 +10:00
wininet5.pas chore(windows): move shared general units to common 2022-06-22 13:58:58 +10:00