I'm trying to write a script for an FPS game. The idea is very simple. When player releases one of the movement keys (W-A-S-D) the character still keeps "sliding" for a second. This leads to few first shots inaccuracy.
I see two ways of implementation. First one is tapping the opposite direction keys (I release A key, script presses D key, I release D key, script presses A key etc). Second one is stoping all movement when LMB is pressed/held (not sure about this one).
So I did something like this:
Code: Select all
~*a up::
SendInput {d down}
Sleep 130
SendInput {d up}
return
~*d up::
SendInput {a down}
Sleep 130
SendInput {a up}
return
First of all game doesn't recognize Send/SendInput unless I use sleep. Too low values lead to no effect at all, too high - to moving in opposite direction. The problem is when I release A and in the exact same time push D I get stuck and can't move for a sleep time (?). Basicly you can't peek around corners while this bug is present. Any help?