Jump to content
Sign in to follow this  

_MouseClick UDF

Recommended Posts


I was looking for UDF that can click side buttons, but I couldn't find one, so I decided to write my own.

It's a simple UDF that can send mouse clicks of middle button, X1 and X2 buttons.


#include <_mouseclick.au3>

_MouseClick(Button[, State of button])

Sample usage:

#include <_mouseclick.au3>

_MouseClick('x2')    ;clicks X2 button
_MouseClick('x1', 'down');clicks X1 button but does not release it
_MouseClick('middle', 'up');releases middle button


Button - Button to click. (middle, x1, x2)

State of button - (down, up, click). Default is 'click'

Return Values

On Failure:

- sets @ERROR = 1 if DllCall fails

- sets @ERROR = 2 if wrong button specified

- sets @ERROR = 3 if wrong keystate specified


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this