version 6.0
POST EVENT (what; message; when; mouseX; mouseY; modifiers{; process})
Parameter | Type | Description | |
what | Number | Type of event | |
message | Number | Event message | |
when | Number | Event time expressed in ticks | |
mouseX | Number | Horizontal coordinate of mouse | |
mouseY | Number | Vertical coordinate of mouse | |
modifiers | Number | Modifier keys state | |
process | Number | Destination process reference number, or | |
Application event queue, if omitted, or 0 |
Description
The POST EVENT command simulates a keyboard or mouse event. Its effect is as if the user actually acted on the keyboard or the mouse.
You pass one of the following values in what:
Constant | Type | Value |
Mouse down event | Long Integer | 1 |
Mouse up event | Long Integer | 2 |
Key down event | Long Integer | 3 |
Key up event | Long Integer | 4 |
Auto key event | Long Integer | 5 |
If the event is a mouse-related event, you pass 0 (zero) in message. If the event is a keyboard-related event, you pass the ASCII code of the simulated character in message.
Usually, you pass the value returned by Tickcount in when.
If the event is a mouse-related event, you pass the horizontal and vertical coordinates of the click in mouseX and mouseY.
In the parameter modifiers, you pass one or a combination of the Events (modifiers) constants. For example, to simulate the Shift key, pass Shift key bit.
If you specify the process parameter, the event is sent to the process whose process number you pass in process. If you pass 0 (zero) or if you omit the parameter, the event is sent at the application level, and the 4D scheduler will dispatch it to the appropriate process.
See Also