FlushEvents [kind][,source]
Parameters
|
kind (optional) - which events to discard: -1: every kind (default) an exact event id, like $401 or $103: only events with that id a family value with a clear low byte, like $200 or $800: every id in that family source (optional) - only discard events from this gadget or window handle; 0 matches any source (default) |
Description
|
Discards queued events without handling them. Requires Extended language mode. Empties matching events out of the shared queue. The classic moment is after something slow or modal - a long export, a Confirm dialog - when a backlog of clicks and key presses has piled up that you do not want replayed into your gadgets the instant the tool wakes up. The kind value works like the event id families: -1 clears everything; a full id such as $401 clears exactly that kind; a family value such as $200 clears all six mouse events ($201-$206), and $800 all four window events. Add a source handle to be surgical - FlushEvents $201,canvas throws away only the mouse-down backlog of one canvas. Pending native messages are processed first, so input that has only just arrived is caught by the flush too. The current event - the one WaitEvent or PeekEvent already fetched - is not affected. The world editor shell sample shows the event loop this cleans up for. See also: WaitEvent, PeekEvent, EventID, EventSource. |
Index