4D v14.3

POST EVENT

Home

 
4D v14.3
POST EVENT

POST EVENT 


 

POST EVENT ( what ; message ; when ; mouseX ; mouseY ; modifiers {; process} ) 
Parameter Type   Description
what  Longint in Type of event
message  Longint in Event message
when  Longint in Event time expressed in ticks
mouseX  Longint in Horizontal coordinate of mouse
mouseY  Longint in Vertical coordinate of mouse
modifiers  Longint in Modifier keys state
process  Longint in Destination process reference number, or Application event queue, if omitted, or 0

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
Auto key event Longint 5
Key down event Longint 3
Key up event Longint 4
Mouse down event Longint 1
Mouse up event Longint 2


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 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 constants of the Events (Modifiers) theme.

Constant Type Value Comment
Activate window bit Longint 0
Activate window mask Longint 1
Caps lock key bit Longint 10
Caps lock key mask Longint 1024
Command key bit Longint 8
Command key mask Longint 256 Windows = Ctrl key, Mac OS = Command key
Control key bit Longint 12
Control key mask Longint 4096 Mac OS only
Mouse button bit Longint 7
Mouse button mask Longint 128
Option key bit Longint 11
Option key mask Longint 2048 Windows = Alt key, Mac OS = Option key
Right control key bit Longint 15
Right control key mask Longint 32768
Right option key bit Longint 14
Right option key mask Longint 16384
Right shift key bit Longint 13
Right shift key mask Longint 8192
Shift key bit Longint 9
Shift key mask Longint 512 Windows and Mac OS

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.

 
PROPERTIES 

Product: 4D
Theme: User Interface
Number: 467

 
HISTORY 

Created: 4D v6

 
SEE ALSO 

POST CLICK
POST KEY

 
ARTICLE USAGE

4D Language Reference ( 4D v11 SQL Release 6)
4D Language Reference ( 4D v12.4)
4D Language Reference ( 4D v14 R2)
4D Language Reference ( 4D v14 R3)
4D Language Reference ( 4D v13.5)
4D Language Reference ( 4D v14.3)
4D Language Reference ( 4D v14 R4)