mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-02-20 19:02:23 +00:00
sdl: fix key repeat (SDL_EnableKeyRepeat was called too early)
This commit is contained in:
parent
fa9548fcad
commit
27b3d27584
1 changed files with 13 additions and 12 deletions
|
@ -605,6 +605,19 @@ void
|
|||
IN_KeyboardInit(Key_Event_fp_t fp)
|
||||
{
|
||||
Key_Event_fp = fp;
|
||||
|
||||
/* SDL stuff. Moved here from IN_BackendInit because
|
||||
* this must be done after video is initialized. */
|
||||
SDL_EnableUNICODE(0);
|
||||
SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
|
||||
if (SDL_WM_GrabInput(SDL_GRAB_QUERY) == SDL_GRAB_ON)
|
||||
{
|
||||
mouse_grabbed = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
mouse_grabbed = false;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -633,18 +646,6 @@ IN_BackendInit(in_state_t *in_state_p)
|
|||
|
||||
mouse_x = mouse_y = 0.0;
|
||||
|
||||
/* SDL stuff */
|
||||
SDL_EnableUNICODE(0);
|
||||
SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
|
||||
if (SDL_WM_GrabInput(SDL_GRAB_QUERY) == SDL_GRAB_ON)
|
||||
{
|
||||
mouse_grabbed = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
mouse_grabbed = false;
|
||||
}
|
||||
|
||||
windowed_mouse = ri.Cvar_Get("windowed_mouse", "1",
|
||||
CVAR_USERINFO | CVAR_ARCHIVE);
|
||||
in_grab = ri.Cvar_Get("in_grab", "2", CVAR_ARCHIVE);
|
||||
|
|
Loading…
Reference in a new issue