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...
This commit is contained in:
Bastien Montagne 2016-02-08 15:41:39 +01:00
parent dae8326d1e
commit 6e16becffd
Notes: blender-bot 2023-02-14 08:14:48 +01:00
Referenced by issue #47354, accented characteres
1 changed files with 6 additions and 5 deletions

View File

@ -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) &&