Perform a mouse click operation.
MouseClick "button" [, x, y [, clicks [, speed ]]]
Parameters
button | The button to click: "left", "right", "middle", "main", "menu", "primary", "secondary". |
x, y | [optional] The x/y coordinates to move the mouse to. If no x and y coords are given, the current position is used. |
clicks | [optional] The number of times to click the mouse. Default is 1. |
speed | [optional] the speed to move the mouse in the range 1 (fastest) to 100 (slowest). A speed of 0 will move the mouse instantly. Default speed is 10. |
Return Value
None.
Remarks
If the button is an empty string, the left button will be clicked.Button | Normal | Swapped |
"" | Left | Left |
"left" | Left | Left |
"middle" | Middle | Middle |
"right" | Right | Right |
"primary" | Left | Right |
"main" | Left | Right |
"secondary" | Right | Left |
"menu" | Right | Left |
Related
MouseClickDrag, MouseGetPosX, MouseGetPosY, MouseMove, MouseCoordMode (Option)
Example
Set oAutoIt = WScript.CreateObject("AutoItX3.Control")
' Double click at the current mouse pos
oAutoIt.MouseClick "left"
oAutoIt.MouseClick "left"
' Double click at 0,500
oAutoIt.MouseClick "left", 0, 500, 2