Receiving EventsYou can use the
GetNextEventfunction to retrieve an event from the Event Manager and remove the event from the event stream. To provide greater support for multitasking, however, you should use the
WaitNextEventfunction instead of
GetNextEventwhenever possible. You can use the
to look at an event without removing it from the event stream. You can use the
AcceptHighLevelEventfunction to get additional information associated with a high-level event and
GetSpecificHighLevelEventto search for a specific high-
FlushEventsprocedure removes all low-level events from the Operating System event queue. In general, your application should not empty the event queue.
You can use the
SystemClickprocedure to route events to desk accessories when necessary. The
SystemEventroutines are used by the Event Manager, and your application usually does not need to call these two routines.
You usually use the functions provided by the Toolbox Event Manager to retrieve events from the event stream. Even if you are interested only in the events stored in the Operating System event queue, you can retrieve these events using the Toolbox Event Manager by setting the event mask to mask out all events except keyboard, mouse, and disk-inserted events. However, you can choose to use Operating System Event Manager routines to perform this task.
The Operating System Event Manager provides two functions,
OSEventAvail, to retrieve events from the Operating System event queue. In most cases, your application will not need to use these two functions.
If your application needs to receive key-up events, you can change the system event mask of your application using the
GetEvQHdrfunction returns a pointer to the header of the Operating System event queue.