Sign in to follow this  
Followers 0
Hatrick

[Help] Event On Right Mouse Click Down?

7 posts in this topic

#1 ·  Posted (edited)

Ok this is my sad attempt for a simple right mouse click down event: It should click left mouse button over and over every 100milliseconds, but it doesnt.

HotKeySet("{MouseDown ( "Right" )}", "Click")
HotKeySet("{ESC)}", "Terminate")

while 1
    sleep(100)
WEnd

Func Click()
 send("{MouseClick ( "left" )}")
 sleep(100)
EndFunc

Func Terminate()
  Exit 0
EndFune

It gives of an error:

HotKeySet(" {MouseDown( "Right" )}","Click")
 HotKeySet(" {MouseDown( "Right^ERROR

please help

Edited by Hatrick

Share this post


Link to post
Share on other sites



You cannot set MouseClick as Hotkey. Look up _IsPressed() in the Misc.au3 includes.

Also to send a mouse click you do not need send func to wrap it.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

ok im lost now.. Could you help please

#include <Misc.au3>

HotKeySet("{ESC)}", "Terminate")

While 1
    If _IsPressed(02) then
    Do
    //What Goes Here to click left mouse button?
        Until Not _IsPressed(02)
    sleep(100)
    EndIf
WEnd

Func Terminate()
  Exit 0
EndFunc
Edited by Hatrick

Share this post


Link to post
Share on other sites

#include <Misc.au3>

HotKeySet("{ESC)}", "Terminate")

While 1
    If _IsPressed("02") then
    Do
    Sleep(1)
    Until Not _IsPressed("02")
    MouseClick("left")
    Sleep(100)
    EndIf
WEnd

Func Terminate()
  Exit 0
EndFunc

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

thanks mate. If i hold right click down it will keep left click as well, or will it break rightc lick. (if so can i change it to hold R down to left click)

e.g.

#include <Misc.au3>

HotKeySet("{ESC)}", "Terminate")

While 1
    If _IsPressed("52") then
    Do
    Sleep(1)
    Until Not _IsPressed("52")
    MouseClick("left")
    Sleep(100)
    MouseClick("left")
    Sleep(100)
    MouseClick("left")
    Sleep(100)
    MouseClick("left")
    Sleep(100)
    EndIf
WEnd

Func Terminate()
  Exit 0
EndFunc
Edited by Hatrick

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

thanks mate. If i hold right click down it will keep left click as well, or will it break rightc lick. (if so can i change it to hold R down to left click)

The above script Executes LeftClicks after you released RightClick. Not sure what you want, but just play around with the code and test it base on your needs. Edited by Generator

Share this post


Link to post
Share on other sites

Thanks again Generator :)

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  
Followers 0