SetKeyDelay problem Topic is solved

Ask gaming related questions
Keal_Legaxy
Posts: 2
Joined: 21 Apr 2018, 06:49
Facebook: forgotten.or.unnamed

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] [Download] (Macro.ahk)GeSHi © Codebox Plus

~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] [Download] (Macro.ahk)GeSHi © Codebox Plus

~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: 1281
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: SetKeyDelay problem  Topic is solved

21 Apr 2018, 08:07

Hallo,
try:

Code: [Select all] [Download] GeSHi © Codebox Plus

~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
Facebook: forgotten.or.unnamed

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”

Who is online

Users browsing this forum: No registered users and 14 guests