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>2016-02-08 17:41:39 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2016-02-08 17:46:11 +0300
commit6e16becffd5725d2403724ef60d5f5bae30d828f (patch)
tree618bcf1130c87e151453b60ad0db9cff068d771a /source/blender/windowmanager/intern/wm_event_system.c
parentdae8326d1e98632be42e525011c061d46c1d0e2a (diff)
Fix T47354: Garbage key events (UNKOWNKEY) would remain in backup event's keymodifier.
For some reason, using 'dead keys' to compose some accentuated latin chars will generate some 'unknown' key events, and in this case, direct `event.keymodifier` was correctly cleared, but not its 'backup' version in `win->eventstate`, so all further events would get an invalid modifier until some real one would be pressed again...
Diffstat (limited to 'source/blender/windowmanager/intern/wm_event_system.c')
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 82284ef8d29..4239ccc1b69 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -3410,11 +3410,12 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
if (event.keymodifier == event.type)
event.keymodifier = 0;
- /* this case happened with an external numpad, it's not really clear
- * why, but it's also impossible to map a key modifier to an unknown
- * key, so it shouldn't harm */
- if (event.keymodifier == UNKNOWNKEY)
- event.keymodifier = 0;
+ /* this case happens with an external numpad, and also when using 'dead keys' (to compose complex latin
+ * characters e.g.), it's not really clear why.
+ * Since it's impossible to map a key modifier to an unknown key, it shouldn't harm to clear it. */
+ if (event.keymodifier == UNKNOWNKEY) {
+ evt->keymodifier = event.keymodifier = 0;
+ }
/* if test_break set, it catches this. Do not set with modifier presses. XXX Keep global for now? */
if ((event.type == ESCKEY && event.val == KM_PRESS) &&