Fixes:
- No key state clear when SDL gets restarted.
- Key state clear was the wrong action - it allows all keys to get pressed
again, but does not actually release anything in cl_input.c, so e.g. +jump
binds stay pressed on vid_restart.
Only vid_wgl.c retains some vid-specific handling (reset of key state when
alt-tabbing out and back in) - there's a chance that we may need similar logic
in the other vid drivers; if so, it may be possible to do this in a shared
place too by watching for changes to vid_activewindow.
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12362
d7cf8633-e32d-0410-b094-
e92efae38249
::stable-branch::merge=
23fba558a074bc8f7b32f9dceae4a2eb96f1789a
// now all keys are guaranteed down (once the event queue is unblocked)
// and only future events count
}
-
-/*
-===================
-Key_ClearStates
-===================
-*/
-void
-Key_ClearStates (void)
-{
- memset(keydown, 0, sizeof(keydown));
-}
void Key_Init_Cvars(void);
void Key_Event(int key, int ascii, qboolean down);
void Key_ReleaseAll (void);
-void Key_ClearStates (void); // FIXME: should this function still exist? Or should Key_ReleaseAll be used instead when shutting down a vid driver?
void Key_EventQueue_Block(void);
void Key_EventQueue_Unblock(void);
vid_isfullscreen = false;
GL_CloseLibrary();
- Key_ClearStates ();
}
// Since the event handler can be called at any time, we store the events for later processing
ctx = NULL;
GL_CloseLibrary();
- Key_ClearStates ();
}
static void signal_handler(int sig)
static void VID_OpenSystems(void)
{
+ Key_ReleaseAll();
R_Modules_Start();
S_Startup();
}
{
S_Shutdown();
R_Modules_Shutdown();
+ Key_ReleaseAll();
}
qboolean vid_commandlinecheck = true;
*/
static void ClearAllStates (void)
{
- Key_ClearStates ();
+ Key_ReleaseAll();
if (vid_usingmouse)
mouse_oldbuttonstate = 0;
}