}
}
+// a helper to simulate release of ALL keys
+void
+Key_ReleaseAll (void)
+{
+ int key;
+ // clear the event queue first
+ eventqueue_idx = 0;
+ // then send all down events (possibly into the event queue)
+ for(key = 0; key < MAX_KEYS; ++key)
+ if(keydown[key])
+ Key_Event(key, 0, false);
+ // now all keys are guaranteed down (once the event queue is unblocked)
+ // and only future events count
+}
+
/*
===================
Key_ClearStates
void Key_Shutdown(void);
void Key_Init_Cvars(void);
void Key_Event(int key, int ascii, qboolean down);
-void Key_ClearStates (void);
+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);