Need help: WASD hold toggle Topic is solved

Ask gaming related questions
Gorgrif
Posts: 3
Joined: 17 Oct 2020, 10:30

Need help: WASD hold toggle

17 Oct 2020, 10:49

Hi guys, im trying to make a script for WASD hold toggle, have some physical problems with hands and cant hold buttons for long time.
What i need is a script, that can hold a button (for example W), when i press ctrl+W, i made a script that can do that, but its not exactly that i need.

Here is my script, it works, but i want to toggle not with z x c b, but with ctrl+w, ctrl+a, ctrl+s, ctrl+d (or with any numpad buton+wasd, instead of ctrl)

Code: Select all

z::Send % "{a " . ( GetKeyState("a") ? "Up}" : "Down}" )
x::Send % "{d " . ( GetKeyState("d") ? "Up}" : "Down}" )
c::Send % "{w " . ( GetKeyState("w") ? "Up}" : "Down}" )
b::Send % "{s " . ( GetKeyState("s") ? "Up}" : "Down}" )
[Mod edit: [code][/code] tags added.]
Gorgrif
Posts: 3
Joined: 17 Oct 2020, 10:30

Re: Need help: WASD hold toggle

17 Oct 2020, 15:04

I made another script, but somehow it doesnt work if i set key ^w, ^a, ^s, ^d but works if i set any other buttons, except WASD

Code: Select all

^w::Send % "{w " . ( GetKeyState("w") ? "Up}" : "Down}" )
^a::Send % "{a " . ( GetKeyState("a") ? "Up}" : "Down}" )
^s::Send % "{s " . ( GetKeyState("s") ? "Up}" : "Down}" )
^d::Send % "{d " . ( GetKeyState("d") ? "Up}" : "Down}" )
Rohwedder
Posts: 3503
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Need help: WASD hold toggle  Topic is solved

18 Oct 2020, 02:12

Hallo,
try:

Code: Select all

^w Up::Send % "{w " . ( GetKeyState("w") ? "Up}" : "Down}" )
^a Up::Send % "{a " . ( GetKeyState("a") ? "Up}" : "Down}" )
^s Up::Send % "{s " . ( GetKeyState("s") ? "Up}" : "Down}" )
^d Up::Send % "{d " . ( GetKeyState("d") ? "Up}" : "Down}" )
Gorgrif
Posts: 3
Joined: 17 Oct 2020, 10:30

Re: Need help: WASD hold toggle

18 Oct 2020, 05:45

It works now. Thanks mate, this helps me a lot!

Return to “Gaming”

Who is online

Users browsing this forum: No registered users and 7 guests