Important: The information in this document is obsolete and should not be used for new development.
PostEvent
The Toolbox Event Manager uses thePostEvent
function to post events into the Operating System event queue. In most cases your application should not call thePostEvent
function.
FUNCTION PostEvent (eventNum: Integer; eventMsg: LongInt): OSErr;
eventNum
- 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 thatPostEvent
should post in the queue.DESCRIPTION
In theeventNum
andeventMsg
parameters, you specify the value for thewhat
andmessage
fields of the event's event record. ThePostEvent
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
PostEvent
function posts only events that are enabled by the system event mask. If the event queue is full,PostEvent
removes the oldest event in the queue and posts the new event.Note that if you use
PostEvent
to repost an event, thePostEvent
function fills out thewhen
,where
, andmodifier
fields of the event record, giving these fields of the reposted event different values from the values contained in the original 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 with the event code and register D0 with the event
message before invokingPostEvent. When PostEvent returns, register D0
contains the result code.
Registers on entry A0 Event number (low-order word) D0 Event message (long)
Registers on exit D0 Result code (low-order word) RESULT CODES
evtNotEnb 1 Event type not valid--event not posted noErr 0 No error