Important: The information in this document is obsolete and should not be used for new development.
GetNextEvent
Although you should normally useWaitNextEvent
, you can also use theGetNextEvent
function to retrieve events one at a time from the Event Manager.
FUNCTION GetNextEvent (eventMask: Integer; VAR theEvent: EventRecord): Boolean;
eventMask
- A value that indicates which kinds of events are to be returned; this parameter is interpreted as a sum of event mask constants (listed in "Setting the Event Mask" beginning on page 2-26). If no event of any of the designated types is available,
GetNextEvent
returns a null event.theEvent
- The next available event of the specified type or types. The
GetNextEvent
function removes the returned event from the
event stream and returns the information about the event in an
event record. The event record includes the type of event received
and other information.DESCRIPTION
GetNextEvent
returnsFALSE
as its function result if the event being returned is a null event or ifGetNextEvent
has intercepted the event; otherwise,GetNextEvent
returnsTRUE
. TheGetNextEvent
function calls the Operating System Manager functionSystemEvent
to determine whether the event should be handled by the application or the Operating System.Like
WaitNextEvent
, theGetNextEvent
function calls theSystemTask
procedure to give time to each open desk accessory or device driver to perform any periodic action defined for it. TheGetNextEvent
function also makes the alarm go off if the alarm is set and the current time is the alarm time. (The user sets the alarm using the Alarm Clock desk accessory.)The
GetNextEvent
function also intercepts Command-Shift-number key sequences
and calls the corresponding 'FKEY
' resource to perform the associated action. The Event Manager's processing of Command-Shift-number key sequences with numbers
3 through 9 can be disabled by setting theScrDmpEnable
global variable (a byte) to 0.SPECIAL CONSIDERATIONS
For greater support of the multitasking environment, your application should useWaitNextEvent
instead ofGetNextEvent
whenever possible. If your application does callGetNextEvent
, it should also call theSystemTask
procedure.SEE ALSO
See "The Event Record," beginning on page 2-79, for a description of the fields in the event record. For information on theSystemTask
procedure, see page 2-95.