This is what I'm trying to do: - press left mouse button (LMB click) to start an action and also send a keystroke {L} but.. when i hold LMB I would like it to keep it that way for as long as I am pressing LMB, and also repeatedly send a keystroke {L} (or just send it once on LMB down). All of this should work no matter what other buttons are pressed.
I tried a lot of combinations with if/else/loops/until and stuff like that but apparently I do not understand AHK well enough to be able to make a functional script.
First I came up with this:
Code: Select all
*LButton::
While GetKeyState ("LButton","P")
{
Send {LButton}
Send {L}
}
return
Code: Select all
*LButton::
Send {LButton down}
random, time, 25, 50
sleep, time
GetKeyState("LButton","P")
if state = D
Send {LButton down}
else
Send {LButton}
random, time, 25, 50
sleep, time
Send {LButton up}
return
This is another thing I came up with :
Code: Select all
*LButton::
loop, 2
{
Send {l down}
KeyWait, LButton
GetKeyState, state, LButton, P
if state = P
Send {LButton down}
else
Send {LButton}
Send {l up}
}
return
Well I hope you get what I mean. Show me the way please...