From 968fc333565bdca42ea6b6d88e6c6a93ead905b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Thu, 23 Nov 2023 15:18:58 +0100 Subject: [PATCH] win32u: Support SGCAPS attributes in KBDTABLES. --- dlls/win32u/input.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index fa64de881cf..3ee46f0bfcf 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -531,6 +531,11 @@ static WCHAR kbd_tables_vkey_to_wchar( const KBDTABLES *tables, UINT vkey, const for (entry = table->pVkToWchars; entry->VirtualKey; entry = NEXT_ENTRY(table, entry)) { if (entry->VirtualKey != vkey) continue; + /* SGCAPS attribute may be set on entries where VK_CAPITAL and VK_SHIFT behave differently. + * The entry corresponds to the mapping when Caps Lock is on, and a second entry follows it + * with the mapping when Caps Lock is off. + */ + if ((entry->Attributes & SGCAPS) && !caps) entry = NEXT_ENTRY(table, entry); if ((entry->Attributes & CAPLOK) && table->nModifications > caps_mod) return entry->wch[caps_mod]; return entry->wch[mod]; }