AutoIt MouseClickDrag Function

The MouseClickDrag function may be used to perform click and drag operations.

3660 views

Edited: 2021-02-14 02:31

The AutoIt MouseClickDrag function can be used to make selections and to move objects on the screen.

Example:

MouseClickDrag("left", 0, 0, 250, 250)

Parameters

The MouseClickDrag function accepts 6 Parameters, these are all shown below. The pixel values are the x and y positions to start and end the dragging operation from.

First parameter:

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.

2nd parameter:

The top and left position to start from in pixels. E.g:

0, 200

3nd parameter:

The top and left position wheres to end the drag. E.g.:

100, 400

4nd parameter:

The movement speed of the mouse, takes a value from 1 to 100. A speed of 0 will move the pointer instantly.

Tell us what you think:

  1. How to declare and work with variables in AutoIt, as well as some background information.
  2. Everything you need to know about working with minimized windows.
  3. How to set the request headers when performing HTTP requests.
  4. This Tutorial will focus on post requests in AutoIt, using the Winhttprequest.5.1 object.
  5. How to use while, for, and do until loops, and how to loop through arrays and object in AutoIt.

More in: AutoIt Tutorials