Fix T100354: Home key being the grave accent in french keyboard layout

I'm still not sure how the `0xFF` value came about, but it's not a
valid virtual key code.

Therefore it should not be used in `MapVirtualKey`.
This commit is contained in:
Germano Cavalcante 2022-08-12 18:54:08 -03:00
parent c1c0473a7e
commit ffd4f4a486
Notes: blender-bot 2023-02-14 06:55:40 +01:00
Referenced by issue #100888,  shortcut problem
Referenced by issue #100354, French-Canadian keyboard: Blender thinks the Home key is the grave accent (`) key.
1 changed files with 5 additions and 0 deletions

View File

@ -638,6 +638,11 @@ GHOST_TKey GHOST_SystemWin32::hardKey(RAWINPUT const &raw,
GHOST_TKey GHOST_SystemWin32::processSpecialKey(short vKey, short scanCode) const
{
GHOST_TKey key = GHOST_kKeyUnknown;
if (vKey == 0xFF) {
/* 0xFF is not a valid virtual key code. */
return key;
}
char ch = (char)MapVirtualKeyA(vKey, MAPVK_VK_TO_CHAR);
switch (ch) {
case u'\"':