OSEventAvail
OSEventAvail Low-level read event without dequeuing it
#include <OSEvents.h> Event Manager
Boolean OSEventAvail( eventMask, theEvent );
short eventMask ; bit flags for events; 0xFFFF is all events
EventRecord *theEvent ; receives the 16-byte event record
returns Is theEvent a null event?
OSEventAvail is identical to GetOSEvent except that it does not remove the
event from the event queue. This lets you check for the occurrence of a
specific event (or any event) but leave it in the queue for later processing.
eventMask is a 16-bit binary mask describing which events to
include/exclude. Use eventMask =everyEvent ( defined as -1) to
include all events. See Event Mask for the layout.
Some events (e.g., keyUp events) may never make it into the event
queue. See SetEventMask.
theEvent is the address of a 16-byte EventRecord. Upon return, it is filled
with an event description. See GetNextEvent.
Returns: a Boolean value; it identifies whether a requested event was found.
It will be one of:
FALSE This is a null event or one you did not request. Ignore it.
TRUE This event is intended for you. Examine and respond.

Notes: In a busy system, it is possible that an event read via this call will be
discarded before it can be processed. The Event Manager usually keeps
only 20 events, scrapping the oldest unread events to make room for new
ones.