Page 1 of 1

Need help: WASD hold toggle

Posted: 17 Oct 2020, 10:49
by Gorgrif
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.]

Re: Need help: WASD hold toggle

Posted: 17 Oct 2020, 15:04
by Gorgrif
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}" )

Re: Need help: WASD hold toggle  Topic is solved

Posted: 18 Oct 2020, 02:12
by Rohwedder
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}" )

Re: Need help: WASD hold toggle

Posted: 18 Oct 2020, 05:45
by Gorgrif
It works now. Thanks mate, this helps me a lot!