win32u: Force US layout in ToUnicode when CTRL is pressed.

The host layout behave very differently in that case and we have tests
that check the exact results.
This commit is contained in:
Rémi Bernon 2023-08-26 14:54:09 +02:00 committed by Alexandre Julliard
parent ca02df5c3f
commit 027f73fcd5

View file

@ -516,6 +516,11 @@ static WCHAR kbd_tables_vkey_to_wchar( const KBDTABLES *tables, UINT vkey, const
if (ctrl && alt) return WCH_NONE;
if (!ctrl && vkey == VK_ESCAPE) return VK_ESCAPE;
if (ctrl && !alt)
{
if (vkey >= 'A' && vkey <= 'Z') return vkey - 'A' + 1;
tables = &kbdus_tables;
}
mod = caps_mod = kbd_tables_get_mod_num( tables, state, FALSE );
if (caps) caps_mod = kbd_tables_get_mod_num( tables, state, TRUE );
@ -531,7 +536,6 @@ static WCHAR kbd_tables_vkey_to_wchar( const KBDTABLES *tables, UINT vkey, const
}
}
if (ctrl && vkey >= 'A' && vkey <= 'Z') return vkey - 'A' + 1;
return WCH_NONE;
}