mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-02-01 21:51:08 +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,11 +415,22 @@ IN_Update(void)
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#if !SDL_VERSION_ATLEAST(2, 0, 0)
|
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
||||||
case SDL_WINDOWEVENT_FOCUS_LOST:
|
case SDL_WINDOWEVENT:
|
||||||
Key_MarkAllUp();
|
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
|
#endif
|
||||||
}
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Grab and ungrab the mouse if the* console or the menu is opened */
|
/* Grab and ungrab the mouse if the* console or the menu is opened */
|
||||||
|
|
Loading…
Reference in a new issue