Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Macintosh Toolbox Essentials /
Chapter 2 - Event Manager / Event Manager Reference
Event Manager Routines


Receiving Events

You can use the WaitNextEvent or GetNextEvent function 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 WaitNextEvent function instead of GetNextEvent whenever possible. You can use the EventAvail function
to look at an event without removing it from the event stream. You can use the AcceptHighLevelEvent function to get additional information associated with a high-level event and GetSpecificHighLevelEvent to search for a specific high-
level event.

The FlushEvents procedure 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 SystemClick procedure to route events to desk accessories when necessary. The SystemTask and SystemEvent routines 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, GetOSEvent and 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 SetEventMask procedure. The GetEvQHdr function returns a pointer to the header of the Operating System event queue.


Subtopics
WaitNextEvent
EventAvail
GetNextEvent
AcceptHighLevelEvent
GetSpecificHighLevelEvent
FlushEvents
SystemClick
SystemTask
SystemEvent
GetOSEvent
OSEventAvail
SetEventMask
GetEvQHdr

Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 JUL 1996