mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2024-11-10 07:21:58 +00:00
Another approach to fixing mouse grab/key_dest
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@770 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
1fef74e006
commit
73aee2dd56
3 changed files with 44 additions and 1 deletions
|
@ -686,6 +686,9 @@ void _Host_Frame (float time)
|
|||
if (!Host_FilterTime (time))
|
||||
return; // don't run too fast, or packets will flood out
|
||||
|
||||
// Force key_dest
|
||||
Key_ForceDest ();
|
||||
|
||||
// get new key events
|
||||
Sys_SendKeyEvents ();
|
||||
|
||||
|
|
41
Quake/keys.c
41
Quake/keys.c
|
@ -1014,7 +1014,6 @@ void Key_Event (int key, qboolean down)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===================
|
||||
Key_ClearStates
|
||||
|
@ -1031,3 +1030,43 @@ void Key_ClearStates (void)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
===================
|
||||
Key_ForceDest
|
||||
===================
|
||||
*/
|
||||
void Key_ForceDest (void)
|
||||
{
|
||||
static qboolean forced = false;
|
||||
|
||||
if (cls.state == ca_dedicated)
|
||||
return;
|
||||
|
||||
switch (key_dest)
|
||||
{
|
||||
case key_console:
|
||||
if (forced && cls.state == ca_connected)
|
||||
{
|
||||
forced = false;
|
||||
IN_Activate();
|
||||
key_dest = key_game;
|
||||
}
|
||||
return;
|
||||
case key_game:
|
||||
case key_message:
|
||||
if (cls.state != ca_connected)
|
||||
{
|
||||
forced = true;
|
||||
if (key_dest == key_message)
|
||||
Key_Message(K_ESCAPE);
|
||||
IN_Deactivate(vid.type == MODE_WINDOWED);
|
||||
key_dest = key_console;
|
||||
return;
|
||||
}
|
||||
/* fallthrough */
|
||||
default:
|
||||
forced = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -157,6 +157,7 @@ void Key_Init (void);
|
|||
void Key_WriteBindings (FILE *f);
|
||||
void Key_SetBinding (int keynum, const char *binding);
|
||||
void Key_ClearStates (void);
|
||||
void Key_ForceDest (void);
|
||||
|
||||
void History_Init (void);
|
||||
void History_Shutdown (void);
|
||||
|
|
Loading…
Reference in a new issue