X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=keys.c;h=817ce92da6a38ae589788aa4f374b33ba420db61;hp=ea6e2d5985c397392f77eb1563806ad25adde2b2;hb=137357d6b7e13e7b2d4bbaeb719dfd4f218a1e5e;hpb=a14d8ac6ca1ca641b68a666983531298ee036576 diff --git a/keys.c b/keys.c index ea6e2d59..817ce92d 100644 --- a/keys.c +++ b/keys.c @@ -1959,6 +1959,21 @@ Key_Event (int key, int ascii, qboolean down) } } +// 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