Important: The information in this document is obsolete and should not be used for new development.
PostEvent
The Toolbox Event Manager uses thePostEventfunction to post events into the Operating System event queue. In most cases your application should not call thePostEventfunction.
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
messagefield for the event thatPostEventshould post in the queue.DESCRIPTION
In theeventNumandeventMsgparameters, you specify the value for thewhatandmessagefields of the event's event record. ThePostEventfunction fills out thewhen,where, andmodifiersfields of the event record with the current time, current mouse location, and current state of the modifier keys and mouse button.The
PostEventfunction posts only events that are enabled by the system event mask. If the event queue is full,PostEventremoves the oldest event in the queue and posts the new event.Note that if you use
PostEventto repost an event, thePostEventfunction fills out thewhen,where, andmodifierfields 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