Press a key when a different key has been depressed.

Ask gaming related questions (AHK v1.1 and older)
Sparklingtube
Posts: 3
Joined: 01 Feb 2023, 09:31

Press a key when a different key has been depressed.

Post by Sparklingtube » 01 Feb 2023, 09:34

Hello yall! I'm trying to make a script where if you turn in the game and finish the turn you blinker automatically gets deactivated, unfortunately the game doesnt do this by itself, the turning keys are
a for left
d for right
q for left blinker
e for right blinker.
I already tried making it myself but failed, how can I make this and is it even possible?

gmoises
Posts: 74
Joined: 18 Nov 2017, 16:43

Re: Press a key when a different key has been depressed.

Post by gmoises » 01 Feb 2023, 09:41

It would be easier to help you if you post your code.

Sparklingtube
Posts: 3
Joined: 01 Feb 2023, 09:31

Re: Press a key when a different key has been depressed.

Post by Sparklingtube » 01 Feb 2023, 10:05

gmoises wrote:
01 Feb 2023, 09:41
It would be easier to help you if you post your code.
I got this right now, kinda works, one problem, its holding down D for an infinite amount of time and when I don't use that it only holds down e not d.

Code: Select all

$D::
$E::
loop
{
	If getkeystate("D","P")
		send, {E}
		send, {D down}
	Sleep 5000
	If getkeystate("3","P")
		send, {3}
	Else
		Break	
	MouseClick, Left
	sleep, 0
}
Return

Rohwedder
Posts: 7630
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Press a key when a different key has been depressed.

Post by Rohwedder » 01 Feb 2023, 10:41

Hallo,
Autohotkey notices when you press or release any keys or buttons and can press or release any keys or buttons in response. So only keys or buttons are of interest, not something like turn on or off blinker!

Sparklingtube
Posts: 3
Joined: 01 Feb 2023, 09:31

Re: Press a key when a different key has been depressed.

Post by Sparklingtube » 01 Feb 2023, 11:34

Rohwedder wrote:
01 Feb 2023, 10:41
Hallo,
Autohotkey notices when you press or release any keys or buttons and can press or release any keys or buttons in response. So only keys or buttons are of interest, not something like turn on or off blinker!
The blinker gets turned on with a button

Post Reply

Return to “Gaming Help (v1)”