AutoIt MouseUp Function

The MouseUp function is used to release a mouse button after clicking it using MouseDown.

1961 views

Edited: 2021-02-14 02:24

The AutoIt MouseUp Function is used to perform a MouseUp event at the current pointer position.

The MouseUp function should be used to release a button that has already been pressed, usually by using the MouseDown function.

When performing normal mouse clicks, it is usually better to use MouseClick, since it will automatically handle mouse up and mouse down actions.

Using MouseDown and MouseUp may give you finer control over how long you want the button to be pressed. This can be done by setting a sleep time after pressing down, and before releasing the mouse button. The sleep time should be provided in milliseconds. See the example below:

MouseDown("secondary")
Sleep(1000) ; time to hold the button in milliseconds
MouseUp("secondary")

Parameters

This function only takes 1 parameter, being the button to release.

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:

  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