SetKeyDelay problem Topic is solved

Ask gaming related questions (AHK v1.1 and older)
Keal_Legaxy
Posts: 2
Joined: 21 Apr 2018, 06:49

SetKeyDelay problem

21 Apr 2018, 07:19

At first, I tried to make a macro for combo that spams left mouse button as fast as possible then delay 25ms then press down F button for 265ms

Code: Select all

~LButton::
While GetKeyState("LButton")
{
send {lbutton}
SetKeyDelay, 25,265
sendevent,{f},
}
return
It turned out to spam left mouse button only. :o So I tried applying delay for both buttons.

Code: Select all

~LButton::Toggle:=!Toggle
While !Toggle
{
SetKeyDelay, 25,265
sendevent,{f},{lbutton}
}
return
Now it does not work at all. :headwall:

Could anyone help me fix this problem? I have just started using AHK. I have already read documents about key delay but did not understand. :crazy:
Rohwedder
Posts: 7608
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: SetKeyDelay problem  Topic is solved

21 Apr 2018, 08:07

Hallo,
try:

Code: Select all

~LButton::
SetMouseDelay, 25,265 ;affects mouse (LButton, Click, …)
SetKeyDelay, 25,265 ;affects keyboard (a, b, …)
While GetKeyState("LButton","P")
{
	SendEvent,{Click}f
}
Return
Keal_Legaxy
Posts: 2
Joined: 21 Apr 2018, 06:49

Re: SetKeyDelay problem

21 Apr 2018, 10:45

Thank you a lot. I have just try it out and it works perfectly fine.

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: Google [Bot] and 30 guests