mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-01-22 01:01:18 +00:00
Fix "mark keys up when focus is lost" code, fixes #68
It didn't build on SDL1.2 (I though we tested that?!) and didn't work with SDL2 either. Now it builds and actually works with both SDL1.2 and 2.0
This commit is contained in:
parent
9265dc8cbe
commit
0b9ac6cb99
1 changed files with 15 additions and 4 deletions
|
@ -415,10 +415,21 @@ IN_Update(void)
|
|||
|
||||
break;
|
||||
|
||||
#if !SDL_VERSION_ATLEAST(2, 0, 0)
|
||||
case SDL_WINDOWEVENT_FOCUS_LOST:
|
||||
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
||||
case SDL_WINDOWEVENT:
|
||||
if(event.window.event == SDL_WINDOWEVENT_FOCUS_LOST)
|
||||
{
|
||||
Key_MarkAllUp();
|
||||
}
|
||||
|
||||
#else // SDL1.2
|
||||
case SDL_ACTIVEEVENT:
|
||||
if(event.active.gain == 0 && (event.active.state & SDL_APPINPUTFOCUS))
|
||||
{
|
||||
Key_MarkAllUp();
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue