mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-23 04:52:07 +00:00
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:
parent
aff37eda16
commit
d2f7d27ad0
1 changed files with 5 additions and 0 deletions
|
@ -414,6 +414,11 @@ IN_Update(void)
|
|||
}
|
||||
|
||||
break;
|
||||
|
||||
#if !SDL_VERSION_ATLEAST(2, 0, 0)
|
||||
case SDL_WINDOWEVENT_FOCUS_LOST:
|
||||
Key_MarkAllUp();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue