Hard-coded toggle keys

Ask gaming related questions
Evil-e
Posts: 108
Joined: 04 Sep 2018, 11:09

Hard-coded toggle keys

27 Sep 2018, 09:23

I have lots FPS PC games in which I use crouch to hide behind cover. Unfortunately, many of them program this action as "toggled", so a second key press is necessary to stand up again.

I am looking for a way for AHK to convert this key to "momentary". I press "A" to crouch, but when I let go of this key, my character stands up. I have tried variations of the following script and does not work:

NOTE: I assigned "n" as crouch key in games menu, to hopefully avoid some code issues
--------------------------------------------------------------------

a::
Send {n down}
a up::
Send {n up}
return

--------------------------------------------------------------------

This script and all variations I tired not only fail to crouch at all, but send my character in a perpetual state of attack... lol

Can anyone help me to resolve this issue?

Thanks for reading, Eric :)
I have a bit of experience opening and sending commands to game console and CMD.exe... just ask :)
swagfag
Posts: 2981
Joined: 11 Jan 2017, 17:59

Re: Hard-coded toggle keys

27 Sep 2018, 09:55

Code: Select all

a::
a Up::
	Send n
return
Evil-e
Posts: 108
Joined: 04 Sep 2018, 11:09

Re: Hard-coded toggle keys

27 Sep 2018, 10:23

Thank you, :)

But, now my character fails to crouch, throws all the grenades and wields a knife like Norman Bates unwilling to wait his turn for a shower... :lol:

I tried your code, then this one and a few variables, but always the same results:
--------------------------------------------------------------
a::
Send n
a Up::
send {n up}
--------------------------------------------------------------

Since "attack" and "throw grenade" are not related to crouch in any way, there is some type of issue with the coding of this games controls. I will give your code a try on a different game and see if I still need that pillow ;)

Thanks, Eric
I have a bit of experience opening and sending commands to game console and CMD.exe... just ask :)

Return to “Gaming”

Who is online

Users browsing this forum: adi1998adi and 29 guests