FlushEvents
FlushEvents Discard all or selected events from event queue short eventMask ; which events to discard; 0xFFFF=all
short stopMask ; flush until one of these is found; 0=flush all
FlushEvents discards all (or selected) events chronologically, until it hits a specified event type. It is often used at the beginning of a program to empty
the event queue of spurious keystrokes or clicks left over from the Finder.
eventMask specifies which event(s) should be flushed. It is a 16-bit binary
mask where a 1 elects to flush an event and a 0 keeps the event. The
most common usage is to use eventMask=everyEvent, defined in
stopMask specifies which events (if any) should stop the flushing process.
For instance, if you want to discard all events up to the next
keystroke, use stopMask = keyDown. A value of 0 means to keep
flushing to the end of the queue.
Notes: To purge all events from the queue, use:
Note: FlushEvents will not remove pending highLevelEvents.