In case of focus loss, mark all keys up

Daniel is more or less sure that a stuck Alt key can occure if the user
switches through several windows by Alt-Tab. That sounds resonable,
because the keyup event for Alt may happen when the focus is not on
Quake II. In that case SDL2 misses it and for Quake II the key stays
down. Solve this by capturing the focus loss event and mark all keys
as up.
This commit is contained in:
Yamagi Burmeister 2015-03-31 21:23:04 +02:00
parent aff37eda16
commit d2f7d27ad0

View file

@ -414,6 +414,11 @@ IN_Update(void)
}
break;
#if !SDL_VERSION_ATLEAST(2, 0, 0)
case SDL_WINDOWEVENT_FOCUS_LOST:
Key_MarkAllUp();
#endif
}
}