diff --git a/Quake/in_sdl.c b/Quake/in_sdl.c index 51445ee2..b1674367 100644 --- a/Quake/in_sdl.c +++ b/Quake/in_sdl.c @@ -258,7 +258,7 @@ void IN_Deactivate (qboolean free_cursor) void IN_Init (void) { - prev_gamekey = ((key_dest == key_game && !con_forcedup) || m_keys_bind_grab); + prev_gamekey = Key_GameKey(); #if !defined(USE_SDL2) SDL_EnableUNICODE (!prev_gamekey); @@ -352,7 +352,7 @@ void IN_ClearStates (void) void IN_UpdateForKeydest (void) { - gamekey = ((key_dest == key_game && !con_forcedup) || m_keys_bind_grab); + gamekey = Key_GameKey(); if (gamekey != prev_gamekey) { prev_gamekey = gamekey; diff --git a/Quake/keys.c b/Quake/keys.c index e5cceba4..d5bd7467 100644 --- a/Quake/keys.c +++ b/Quake/keys.c @@ -1117,6 +1117,16 @@ void Key_UpdateForDest (void) IN_UpdateForKeydest (); } +/* +=================== +Key_GameKey +=================== +*/ +qboolean Key_GameKey(void) +{ + return ((key_dest == key_game && !con_forcedup) || m_keys_bind_grab); +} + /* =================== Key_ConsoleBindable diff --git a/Quake/keys.h b/Quake/keys.h index 36da39db..a7af3dca 100644 --- a/Quake/keys.h +++ b/Quake/keys.h @@ -163,6 +163,7 @@ extern qboolean chat_team; void Key_Init (void); void Key_ClearStates (void); void Key_UpdateForDest (void); +qboolean Key_GameKey (void); qboolean Key_ConsoleBindable (int key); void Key_Event (int key, qboolean down);