mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-26 06:20:48 +00:00
Minor input grabbing cleanup.
This commit is contained in:
parent
b33c895d56
commit
98a83e2322
2 changed files with 5 additions and 6 deletions
|
@ -569,13 +569,13 @@ IN_KeyboardInit(Key_Event_fp_t fp)
|
||||||
|
|
||||||
/* SDL stuff. Moved here from IN_BackendInit because
|
/* SDL stuff. Moved here from IN_BackendInit because
|
||||||
this must be done after video is initialized. */
|
this must be done after video is initialized. */
|
||||||
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
|
||||||
SDL_SetRelativeMouseMode(SDL_TRUE);
|
|
||||||
have_grab = GLimp_InputIsGrabbed();
|
have_grab = GLimp_InputIsGrabbed();
|
||||||
|
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
||||||
|
if (have_grab)
|
||||||
|
SDL_SetRelativeMouseMode(SDL_TRUE);
|
||||||
#else
|
#else
|
||||||
SDL_EnableUNICODE(0);
|
SDL_EnableUNICODE(0);
|
||||||
SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
|
SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
|
||||||
have_grab = (SDL_WM_GrabInput(SDL_GRAB_QUERY) == SDL_GRAB_ON);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -708,8 +708,7 @@ qboolean GLimp_InputIsGrabbed()
|
||||||
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
||||||
return SDL_GetWindowGrab(window) ? true : false;
|
return SDL_GetWindowGrab(window) ? true : false;
|
||||||
#else
|
#else
|
||||||
SDL_GrabMode m = SDL_WM_GrabInput(SDL_GRAB_QUERY);
|
return (SDL_WM_GrabInput(SDL_GRAB_QUERY) == SDL_GRAB_ON);
|
||||||
return m == SDL_GRAB_ON;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue