Jump to content

Recommended Posts

Posted

I've tried everything I can think of to create a simple script that will call a function when the left mouse button is doubleclicked. But I have run into every problem from the script working but I'm not able to click an drag anymore with it running to it only working once and then not at all. This is the script I currently have:

#include <MouseSetOnEvent_UDF.au3>

$x = 0

_MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT , "Click")

Sleep(100)

_MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT) ;Enable mouse button back.

While 1

$x += 1

sleep(100)

WEnd

Func Click()

If $x < 3 Then DoubleClick()

$x = 0

;MsgBox(4096,"","Click",2)

EndFunc

Func DoubleClick()

MsgBox(4096,"","DoubleClick",2)

$x = 0

EndFunc

It only works on the first double click and then doen't do anything. Can anyone help?

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...