[Bf-blender-cvs] [82c852f3873] master: Fix D14173: Chinese IME Full Width Numbers

Harley Acheson noreply at git.blender.org
Sat Mar 19 17:06:06 CET 2022


Commit: 82c852f38732a005a1da72f4fb7fb402ecd71ec0
Author: Harley Acheson
Date:   Sat Mar 19 09:05:10 2022 -0700
Branches: master
https://developer.blender.org/rB82c852f38732a005a1da72f4fb7fb402ecd71ec0

Fix D14173: Chinese IME Full Width Numbers

Windows IME: Fix duplicated initial character when entering numbers
while in Chinese full width character mode.

See D14354 for more details.

Differential Revision: https://developer.blender.org/D14354

Reviewed by Brecht Van Lommel

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

M	intern/ghost/intern/GHOST_ImeWin32.cpp

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

diff --git a/intern/ghost/intern/GHOST_ImeWin32.cpp b/intern/ghost/intern/GHOST_ImeWin32.cpp
index 702c10d377b..c3fcd7214ca 100644
--- a/intern/ghost/intern/GHOST_ImeWin32.cpp
+++ b/intern/ghost/intern/GHOST_ImeWin32.cpp
@@ -88,9 +88,14 @@ bool GHOST_ImeWin32::IsImeKeyEvent(char ascii, GHOST_TKey key)
     if (IsLanguage(IMELANG_JAPANESE) && (ascii >= ' ' && ascii <= '~')) {
       return true;
     }
-    else if (IsLanguage(IMELANG_CHINESE) && ascii && strchr("!\"$'(),.:;<>?[\\]^_`/", ascii) &&
-             !(key == GHOST_kKeyNumpadPeriod)) {
-      return true;
+    if (IsLanguage(IMELANG_CHINESE)) {
+      if (ascii && strchr("!\"$'(),.:;<>?[\\]^_`/", ascii) && !(key == GHOST_kKeyNumpadPeriod)) {
+        return true;
+      }
+      if (conversion_modes_ & IME_CMODE_FULLSHAPE && (ascii >= '0' && ascii <= '9')) {
+        /* When in Full Width mode the number keys are also converted. */
+        return true;
+      }
     }
   }
   return false;



More information about the Bf-blender-cvs mailing list