diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-02-08 17:41:39 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-02-08 17:46:11 +0300 |
commit | 6e16becffd5725d2403724ef60d5f5bae30d828f (patch) | |
tree | 618bcf1130c87e151453b60ad0db9cff068d771a | |
parent | dae8326d1e98632be42e525011c061d46c1d0e2a (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...
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 11 |
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) && |