Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2014-02-27 12:45:44 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2014-02-27 12:49:09 +0400
commit17d2e6422cfac5c1fe2f66dba94ad76212876eca (patch)
tree61aa6efef31efe5bc6b79cf1c04eee4e8c57012a
parentd09f2ed322b2b11d16d5c19ac8a5799c1b717b36 (diff)
Hopefully definitively fix the "enter the advanced numinput mode" issue.
Hack around event code and check against ascii code, this way keyboards with "complex" access to '=' and '*' are still able to toggle numinput modes.
-rw-r--r--source/blender/editors/util/numinput.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/source/blender/editors/util/numinput.c b/source/blender/editors/util/numinput.c
index 9cbea14d10a..1f3725a961a 100644
--- a/source/blender/editors/util/numinput.c
+++ b/source/blender/editors/util/numinput.c
@@ -339,17 +339,13 @@ bool handleNumInput(bContext *C, NumInput *n, const wmEvent *event)
utf8_buf = ascii;
break;
case EQUALKEY:
+ /* XXX Advanced mode toggle, hack around keyboards without direct access to '=' nor '*'... */
+ ascii[0] = '=';
+ break;
case PADASTERKEY:
- 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;
- }
- /* fall-through */
+ /* XXX Advanced mode toggle, hack around keyboards without direct access to '=' nor '*'... */
+ ascii[0] = '*';
+ break;
case PADMINUS:
case MINUSKEY:
if (event->ctrl || !(n->flag & NUM_EDIT_FULL)) {
@@ -402,6 +398,19 @@ bool handleNumInput(bContext *C, NumInput *n, const wmEvent *event)
break;
}
+ /* 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;
+ }
+ }
+
if (utf8_buf && !utf8_buf[0] && ascii[0]) {
/* Fallback to ascii. */
utf8_buf = ascii;