Denis
Denis

Reputation: 103

AUTOHOTKEY If left mouse pressed.. loop..something

This is my current code:

LButton::

Send {sc013}
Sleep 10
Send {sc021}
Sleep 10
Return


RButton::

Send {sc014}
Sleep 10
Send {sc021}
Sleep 10
Return

And all what I need is... isnsted of when left mouse/right mouse button clicked do something.....

I need that when left/right mouse button HOLDED loop letter "F".
Thnk you.

Upvotes: 1

Views: 5904

Answers (1)

Sid
Sid

Reputation: 1719

You'll need to use GetKeyState() and a While-loop. So while Rbutton is pressed, send F.

Rbutton::
    while (GetKeyState("Rbutton", "P")) {
        Send, F
    }
return

Upvotes: 3

Related Questions