From 08b9b95147a983af492f0f9db948b680590b448d Mon Sep 17 00:00:00 2001 From: Sebastian Parborg Date: Thu, 26 Mar 2020 12:42:37 +0100 Subject: 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 --- source/blender/editors/util/numinput.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to '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. */ -- cgit v1.2.3