KbQueueFlush
>Psychtoolbox>PsychBasic
nflushed = KbQueueFlush([deviceIndex][flushType=1])
Flush KbQueue and/or KbQueue event buffer. By default, if flushType is
omitted, only the KbQueues events are deleted. Other ‘flushTypes’ affect
the KbQueue event buffer, but rather use the KbEventFlush() function to
do this.
If ‘flushType’ is 0, only the number of currently queued events will be
returned.
If ‘flushType’ is 1, only events returned by KbQueueCheck will be flushed. This
is the default.
If ‘flushType’ is 2, only events returned by KbEventGet will be flushed.
If ‘flushType’ is 3, events returned by both KbQueueCheck and KbEventGet
will be flushed.
If ‘flushType’ is 4, only the number of key-press events with valid, mapped ASCII
CookedKey field will be returned.
Removes all unprocessed events from the queue and zeros out any already
scored events.
_________________________________________________________________________
See also: KbQueueCreate, KbQueueStart, KbQueueStop, KbQueueCheck,
KbQueueWait, KbQueueFlush, KbQueueRelease
Psychtoolbox/PsychBasic/KbQueueFlush.m