[Bf-blender-cvs] [ffd4f4a486c] blender-v3.3-release: Fix T100354: Home key being the grave accent in french keyboard layout

Germano Cavalcante noreply at git.blender.org
Fri Aug 12 23:55:16 CEST 2022


Commit: ffd4f4a486c86fc69c14122372fef05263b572c3
Author: Germano Cavalcante
Date:   Fri Aug 12 18:54:08 2022 -0300
Branches: blender-v3.3-release
https://developer.blender.org/rBffd4f4a486c86fc69c14122372fef05263b572c3

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`.

===================================================================

M	intern/ghost/intern/GHOST_SystemWin32.cpp

===================================================================

diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp
index 5a930209376..7c07ea6cd64 100644
--- a/intern/ghost/intern/GHOST_SystemWin32.cpp
+++ b/intern/ghost/intern/GHOST_SystemWin32.cpp
@@ -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'\"':



More information about the Bf-blender-cvs mailing list