Running won't stop in a game

Ask gaming related questions (AHK v1.1 and older)
WildWilbur
Posts: 5
Joined: 28 May 2023, 16:44

Running won't stop in a game

Post by WildWilbur » 28 May 2023, 17:03

Hi guys,

I'm a old fart and just can't stand playing games with WASD. So I'm screwed if a game forces me to because of lack of changing keys ingame (my newest game: Jedi Survivor).

So I read about AHK and that I could very easily switch WASD with the arrow key. And I figured out this little scrip should to the trick:

Code: Select all

w::up
a::left
s::down
d::right

up::w
left::a
down::s
right::d

F12::ExitApp
And it worked indeed. But after a few minutes when I'm running with my char I'm on "autorun": my char continues to move in the direction of the last key i pushed, f.e. I'm strafing to the right and the char continues to strafe further even I released the key. And he moves further indefinitely. I thought it had somewhat to do with a "overflow" or something because I'm holding a key for too long and threw

#MaxHotkeysPerInterval 9999

as first line into the scrip but that didn't make a difference.

The working walkaround ingame is to release the key and push it again, release again and push the opposite button.

Any ideas what the problem could be or any tips to the (admittingly lousy) scrip of mine? Or ain't AHK the problem but the old brain in front of the keyboard?

Cheers,
WW


[Mod action: Moved topic to ”Gaming”]

[Mod edit: Added [code][/code] tags. Please use them yourself when posting code.]

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

Re: Running won't stop in a game

Post by Rohwedder » 29 May 2023, 03:10

Hallo,
try:

Code: Select all

#InstallKeybdHook
#MaxHotkeysPerInterval 9999 
SetTimer, Release, 100
up::w
left::a
down::s
right::d
Release:
Loop, Parse,% "wasd"
	SendInput,% (GetKeyState(A_LoopField) And 
	!GetKeyState(A_LoopField,"P"))?"{Blind}{" A_LoopField " Up}":""
Return

WildWilbur
Posts: 5
Joined: 28 May 2023, 16:44

Re: Running won't stop in a game

Post by WildWilbur » 29 May 2023, 03:28

Thank you! I have no idea what that will do but will give it a try! :)

User avatar
boiler
Posts: 16768
Joined: 21 Dec 2014, 02:44

Re: Running won't stop in a game

Post by boiler » 29 May 2023, 05:50

This was posted in the v2 section. I’ll move it if you’re actually using v1.

WildWilbur
Posts: 5
Joined: 28 May 2023, 16:44

Re: Running won't stop in a game

Post by WildWilbur » 29 May 2023, 13:52

Ok, I tried and it worked in general. But it stutters when I change keys (from forward to strafe f.e.). It seem to have a litte delay when switching keys and I can't use two keys simultaneously (running forward and strafe the same time)... :(

User avatar
boiler
Posts: 16768
Joined: 21 Dec 2014, 02:44

Re: Running won't stop in a game

Post by boiler » 29 May 2023, 14:01

Moved from the v2 section. Please post in the correct forum (for v1 and for gaming) going forward.

WildWilbur
Posts: 5
Joined: 28 May 2023, 16:44

Re: Running won't stop in a game

Post by WildWilbur » 29 May 2023, 14:50

Ah, ok, thanks. It is indeed v1 - should I switch to AHK v2 instead?

User avatar
boiler
Posts: 16768
Joined: 21 Dec 2014, 02:44

Re: Running won't stop in a game

Post by boiler » 29 May 2023, 15:46

In general, v2 is recommended for new scripts, so I would say switch. Among other things, it eliminates the most common source of confusion in v1 -- the dual syntax of expressions and command syntax. v2 uses expressions only.

WildWilbur
Posts: 5
Joined: 28 May 2023, 16:44

Re: Running won't stop in a game

Post by WildWilbur » 31 May 2023, 17:09

Switched to v2 but got the same problem. Anyone get any ideas maybe?

Post Reply

Return to “Gaming Help (v1)”