Important: The information in this document is obsolete and should not be used for new development.
The Event Queue
The event queue is a standard Macintosh Operating System queue that the Operating System Event Manager maintains. Only mouse-up, mouse-down, key-up, key-down, auto-key, and disk-inserted events are stored in the Operating System event queue. In most cases, your application should not access the event queue directly. Instead you usually use theWaitNextEvent
function, which can retrieve events from this queue as well as from other sources.The event queue consists of a header followed by the actual entries in the queue. The event queue has the same header as all standard Macintosh Operating System queues. The
Qhdr
data type defines the queue header.
TYPE QHdr = RECORD qFlags: Integer; {queue flags} qHead: QElemPtr; {first queue entry} qTail: QElemPtr; {last queue entry} END;TheEvQEl
data type defines an entry in the Operating System event queue.
TYPE EvQEl = RECORD qLink: QElemPtr; {next queue entry} qType: Integer; {queue type (ORD(evType))} evtQWhat: Integer; {event code} evtQMessage: LongInt; {event message} evtQWhen: LongInt; {ticks since startup} evtQWhere: Point; {mouse location} evtQModifiers: Integer; {modifier flags} END;Each entry in the event queue begins with 4 bytes of flags followed by a pointer to the next queue entry. The flags are maintained by and internal to the Operating System Event Manager. The queue entries are linked by pointers, and the first field of theEvQEl
data type, which represents the structure of a queue entry, begins with a pointer to the next queue entry. Thus you cannot directly access the flags using theEvQEl
data type.