I have a problem where I set up a AHK script to repeatedly self-send keys when held down according to a guide in the old forums.
When I hold down the F-Key and D-Key, only on of them is sending, meaning that the script can only perform one loop at a time the way it is setup.
What I want to achieve: When holding down Q,W and E for instance. I want all three loops to perform at the same time. How can I achieve this ?
Moreover, if I use modifier keys like SHIFT or CTRL the snippet below does not work. For example if I want to spam F while holding Shift it won't work. I want to send Shift-F-F-F-F-F...
Sample code:
Code: Select all
$d::
Random, rand, 22,69
KeyWait d, T0.007 ; Wait 1/2 second for user to release "a" key
If ErrorLevel ; Still held down
While GetKeyState("d","p")
{
Send {d down}
Sleep 45
Send {d up}
Sleep rand
}
Else ; They let go in time
Send {d down}
Sleep 35
Send {d up}
return
$f::
Random, rand, 11,50
KeyWait f, T0.007 ; Wait 1/2 second for user to release "a" key
If ErrorLevel ; Still held down
While GetKeyState("f","p")
{
Send {f down}
Sleep 45
Send {f up}
Sleep rand
}
Else ; They let go in time
Send {f down}
Sleep 35
Send {f up}
return