EVT_getNext
Retrieves the next pending event from the event queue.
Declaration
ibool EVTAPI EVT_getNext(
event_t *evt,
ulong mask)
Prototype In
event.h
Parameters
evt |
Pointer to structure to return the event info in |
mask |
Mask specifying the types of events that should be removed |
Return Value
True if an event was pending, false if not.
Description
Retrieves the next pending event from the event queue, and stores it in a event_t structure. The mask parameter is used to specify the type of events to be removed, and can be any logical combination of any of the flags defined by the EVT_eventType enumeration.
The what field of the event contains the event code of the event that was extracted. All application specific events should begin with the EVT_USEREVT code and build from there. Since the event code is stored in an integer, there is a maximum of 32 different event codes that can be distinguished. You can store extra information about the event in the message field to distinguish between events of the same class (for instance the button used in a EVT_MOUSEDOWN event).
If an event of the specified type was not in the event queue, the what field of the event will be set to NULLEVT, and the return value will return false.
Note: You should always use the EVT_EVERYEVT mask for extracting events from your main event loop handler. Using a mask for only a specific type of event for long periods of time will cause the event queue to fill up with events of the type you are ignoring, eventually causing the application to hang when the event queue becomes full.
See Also
Copyright © 2002 SciTech Software, Inc. Visit our web site at http://www.scitechsoft.com