Share via:

AutoIt MouseClickDrag Function

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


Edited: 2019-09-11 16:24

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


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.

left || right || middle || main || menu || primary || secondaryThe mouse button to be clicked before the drag.
pixels,pixelsThe top and left position to start from in pixels
pixels,pixelsThe top and left position wheres to end the drag.
1-100The movement speed of the mouse, takes a value from 1 to 100. A speed of 0 will move the pointer instantly.

If you want to be sure that the primary button is used, regardless of the users setting, then avoid using left, as some users might make the right mouse button their primary instead of the normal left.

AutoIt MouseClickDrag Example

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