Sign in to follow this  
Followers 0
christian11

hold key macro?

4 posts in this topic

#1 ·  Posted (edited)

hi im kinda newbie in autoit can you help me how to make hold key macro?

i want to spam repeatedly the right click mouse button, when i hold right click button, and it will only stop when i release it

#Include <Misc.au3>
While 1
If _IsPressed("02") Then
  Do
    mouseup("right")
   mousedown("right")
   sleep (100)
  Until not _IsPressed("02")
EndIf
WEnd

but it didnt work any suggestions?

Edited by christian11

Share this post


Link to post
Share on other sites



edit: finally i got it make to work, however  it keeps looping/clicking even if I stop holding the right click 

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Because your script is pressing right click... lol Throw in a modifier key like Ctrl/Shift/Alt for your if statement

; If right button and shift are pressed
If (_IsPressed("10") and _IsPressed("02")) Then
    Do
        MouseClick("Right")
        Sleep(50)
    Until (_IsPressed("01"))
EndIf

 

Edited by InunoTaishou

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