AutoIt MouseDown Function
The MouseDown function can be used to click and hold a mouse button.
Edited: 2021-02-14 02:25
The AutoIt MouseDown function is used to perform a MouseDown event, which can later be released by a MouseUp event.
After sending a MouseDown event, you would typically also want to send a MouseUp event.
If you want to make a selection, or perform a mouse drag and drop operation, then consider using the MouseClickDrag Function instead.
Example showing how to do a mouse-down action, followed by a mouse-up action:
MouseDown("secondary")
Sleep(1000) ; time to hold the button in milliseconds
MouseUp("secondary")
Parameters
This function only takes 1 parameter, being the button to press down.
Values:
left
right
middle
main
menu
primary
secondary
Note that primary is used to refer to the primary mouse button, this is useful since a user might change their key mappings — same logic applies for the secondary value.
Tell us what you think: