Jump to content

hold key macro?


Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

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