if key is down, sendinput

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
thankyou
Posts: 5
Joined: 23 Jan 2018, 19:17

if key is down, sendinput

22 Mar 2018, 18:55

i need a way to send an input if for example w is currently being held down
here is a sample of what my script could look like


++LButton::
LButton::
sendinput {a up}
sendinput {w up}
sendinput {d up}
click
if(w is down) sendinput {w down} <-- not real
if(a is down) sendinput {a down} <--not real
if(d is down) sendinput {d down} <--not real
return



the problem is that even tho i never let go of w andor a andor d the game doesnt register continual key holds it only registers changes in key state.
Rohwedder
Posts: 7647
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: if key is down, sendinput

23 Mar 2018, 01:31

Hallo,
I translated it into Autohotkey. But does that make sense?

Code: Select all

+LButton::
LButton::
SendInput {a up}{w up}{d up}
Click
IF GetKeyState("w","P")
	SendInput {w down}
IF GetKeyState("a","P")
	SendInput {a down}
IF GetKeyState("d","P")
	SendInput {d down}
Return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: CrowexBR, demon740, gsxr1300, ht55cd3 and 280 guests