Need to "update" keys after using a script in a game?

Ask gaming related questions
konarktriv7
Posts: 1
Joined: 26 Jul 2020, 02:50

Need to "update" keys after using a script in a game?

26 Jul 2020, 02:55

Hello! I'm an absolute begginer and just started using AHK, and after making my first script and testing it, I noticed that after reloading the script, the keys stay pressed, and I need to press those keys to "update" them and stop that input. Any help is appreciated, thanks!
User avatar
boiler
Posts: 5932
Joined: 21 Dec 2014, 02:44

Re: Need to "update" keys after using a script in a game?

26 Jul 2020, 03:22

Can you show your script? Is it sending a down press of those keys without sending a release?
Rohwedder
Posts: 3415
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Need to "update" keys after using a script in a game?

26 Jul 2020, 07:32

Hallo,
just for scripts to try around I sometimes use:

Code: Select all

OnExit("KeysReset")
Return
KeysReset()
{
	Loop, 0xFF
		IF GetKeyState(Key:=Format("VK{:02X}",A_Index))
			SendInput, {%Key% up}
	ExitApp
}

Return to “Gaming”

Who is online

Users browsing this forum: boiler, zaric1 and 19 guests