[Bf-blender-cvs] [08b9b95147a] master: Fix T75047: Number input advanced mode is not working in JP keyboard

Sebastian Parborg noreply at git.blender.org
Thu Mar 26 12:46:03 CET 2020


Commit: 08b9b95147a983af492f0f9db948b680590b448d
Author: Sebastian Parborg
Date:   Thu Mar 26 12:42:37 2020 +0100
Branches: master
https://developer.blender.org/rB08b9b95147a983af492f0f9db948b680590b448d

Fix T75047: Number input advanced mode is not working in JP keyboard

Check for special ascii values for number input first so that we can
quickly decide if we should go into advanced mode.

Reviewed By: Bastien

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

M	source/blender/editors/util/numinput.c

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

diff --git a/source/blender/editors/util/numinput.c b/source/blender/editors/util/numinput.c
index 3c0d0beebe3..be1319c37dd 100644
--- a/source/blender/editors/util/numinput.c
+++ b/source/blender/editors/util/numinput.c
@@ -340,6 +340,21 @@ bool handleNumInput(bContext *C, NumInput *n, const wmEvent *event)
     }
   }
 
+#ifdef USE_FAKE_EDIT
+  /* XXX Hack around keyboards without direct access to '=' nor '*'... */
+  if (ELEM(event->ascii, '=', '*')) {
+    if (!(n->flag & NUM_EDIT_FULL)) {
+      n->flag |= NUM_EDIT_FULL;
+      n->val_flag[idx] |= NUM_EDITED;
+      return true;
+    }
+    else if (event->ctrl) {
+      n->flag &= ~NUM_EDIT_FULL;
+      return true;
+    }
+  }
+#endif
+
   switch (event->type) {
     case EVT_MODAL_MAP:
       if (ELEM(event->val, NUM_MODAL_INCREMENT_UP, NUM_MODAL_INCREMENT_DOWN)) {
@@ -523,21 +538,6 @@ bool handleNumInput(bContext *C, NumInput *n, const wmEvent *event)
     ascii[0] = event->ascii;
   }
 
-#ifdef USE_FAKE_EDIT
-  /* XXX Hack around keyboards without direct access to '=' nor '*'... */
-  if (ELEM(ascii[0], '=', '*')) {
-    if (!(n->flag & NUM_EDIT_FULL)) {
-      n->flag |= NUM_EDIT_FULL;
-      n->val_flag[idx] |= NUM_EDITED;
-      return true;
-    }
-    else if (event->ctrl) {
-      n->flag &= ~NUM_EDIT_FULL;
-      return true;
-    }
-  }
-#endif
-
   /* Up to this point, if we have a ctrl modifier, skip.
    * This allows to still access most of modals' shortcuts even in numinput mode.
    */



More information about the Bf-blender-cvs mailing list