Important: The information in this document is obsolete and should not be used for new development.
PPostEvent
In most cases your application does not need to post events in the Operating System event queue; however, if you must do so, you can use thePPostEvent
function.
FUNCTION PPostEvent (eventCode: Integer; eventMsg: LongInt; VAR qEl: EvQElPtr): OSErr;
eventCode
- A value that indicates the type of event to post into the Operating System event queue. The types of events that can be posted in this queue are represented by these constants:
mouseDown
,mouseUp
,keyDown
,keyUp
,autoKey
, anddiskEvt
. Do not attempt to post any other type of event in the Operating System event queue.eventMsg
- A long integer that contains the contents of the
message
field for the event thatPPostEvent
should post in the queue.qEl
PPostEvent
returns a pointer to the event queue entry of the posted event in this parameter.DESCRIPTION
In theeventCode
andeventMsg
parameters, you specify the value for thewhat
andmessage
fields of the event's event record. ThePPostEvent
function fills out thewhen
,where
, andmodifiers
fields of the event record with the current time, current mouse location, and current state of the modifier keys and mouse button.The
PPostEvent
function returns a pointer to the event queue entry of the posted event in theqEl
parameter. You can change any fields of the posted event by changing the fields of its event queue entry. For example, you can change the posted event's modifier keys by changing the value of the evtQModifiers field of the event queue entry.The
PPostEvent
function posts only events that are enabled by the system event mask. If the event queue is full,PPostEvent
removes the oldest event in the queue and posts the new event.
- WARNING
- Do not post any events other than mouse-down, mouse-up, key-down, key-up, auto-key, and disk-inserted events in the Operating System event queue. Attempting to post other events into the Operating
System event queue interferes with the internal operation of the
Event Manager.ASSEMBLY-LANGUAGE INFORMATION
You must set up register A0 and register D0 before invokingPPostEvent
. ThePPostEvent
function returns values in registers A0 and D0.
Registers on entry A0 Event number (low-order word) D0 Event message (long)
Registers on exit A0 Pointer to an event queue entry (long) D0 Result code (low-order word) RESULT CODES
evtNotEnb 1 Event type not valid--event not posted noErr 0 No error SEE ALSO
For a description of the entries in the event queue, see "The Event Queue" on page 2-83.