That said, i did read some of the documentation before asking here and wasn't able to find my answers there.
I'm in need of a script that will conditionally swap two of the Keys for a games control scheme, based on a third key being pressed (or not pressed).
(It's Armored Warfare, a Cry-Engine based game, in case this is relevant).
"a" and "d" used for steering, should be just be a & d most of the time.
However, when "s" is also pressed (going in reverse) i need to make "a" output "d" and vice-versa.
It needs to work on both taps and keys being held, and needs to update, when the situation changes (Which is the part where my actual trouble is).
To make things more complicated, the game does not seem to accept any of the Send(), SendInput(), SendPlay() modes.
So i am limited to using the "basic" redirect (not sure the exact term here)
a::d etc works just fine.
This is what i came up with this far:
Code: Select all
#If GetKeyState("s", "P")
#InputLevel 1
a::d
return
#InputLevel 2
d::a
return
#If
It ALMOST works.
However, while it works, when pressing "s" first and then "a" or "d", it fails to update, when say "a" is already pressed, when i press "s".
It kinda makes sense, since my condition is bound to "s", but then again, it kinda doesn't make sense (or rather i obviously misunderstand the flow of the events) - i expected the whole thing to work kinda like game engines works - being run in regular intervals ala "OnUpdate()". However, it seems to work in a different way.
So to get my question to the point - how to i make sure the condition is updated/re-checked either in regular intervals or whenever something changes?
If you can offer any help, to either fix my script or maybe just telling me how it's actually done.
Thanks!