Help with code for Muscular Dystrophy user!
Hello!
Not long ago I started playing an online racing game where I have met countless people and interacted with many on friendlier terms and I came across this one person loves the game, however his condition is making it very difficult to play on keyboard.
This person uses Switch joycon controllers that are remapped through the reWASD application basically mirroring keyboard inputs when used.
In the game, you are able to perform a drift by pressing the Shift button and then choosing to whether Drift to the right or left with either the arrow buttons or a or d buttons. After a drift has been performed, if you press Shift again and the upwards button, you get a small boost. I use keyboard myself and I thought since the reWASD application mirrors anything, maybe I can set something up for the guy?
I created the following code,
Shift::
{ keywait, Shift Sleep, 500 send, Shift } return
Since this person has difficulties pressing multiple buttons at the same time, the above code saves him at least one button click each drift. So when he shifts and performs the drift, the boosting option becomes available within half a second (that's the reason for the delay) so all he should really need to do after a successful drift is to press the upwards button since shift will be repeating itself and thus saving him one click.
What I noticed is that whe nusing the joycon controllers, when driving the code resets? Suddenly the shift button is not performing a secondary action, since there are other inputs such as the joycon WASD controllers being moved.
I believe the solution to this is that a code should have in mind that when W, A, S, D or Shift is pressed together and then released it should repeat the Shift buton after 500ms so that all he needs to do is to press the Upwards button, or W, to perform the drift boost.
I am very new to AHK and I have really tried getting into it, and assist this person since he really loves the game and I'd like him to keep playing instead of giving it up because of his condition so I want to ask help from the community.
Is there anyone willing with knowledge on how we could solve this matter?
Thank you so much in advance.
Ps.
Shift::
{ keywait, Shift keywait, w keywait, d keywait, s keywait, a Sleep, 500 send, Shift } return
The above is another code I tried but I feel like that's totally wrong. I can't seem to find how to combine a keywait with multiple inputs.
Posted May 23, 2020, 8:01 PM UTC
this is the first time ive heard of reWASD. thats a nice looking GUI
ill have a better look into this tomorrow but off the top of my head, i think you might be able to do it by focusing on mapping the up key instead of the shift key.
for example: when "up" is pressed, check what the previous hotkey was (A_PriorHotkey). if it was one of the drifting hotkey combinations, then send shift+up, else just send regular up.
the variables A_TimeSinceThisHotkey and A_TimeSincePriorHotkey could be used as well and make it so shift+up is only sent if the time between those two variables is under 500 ms
Hello, thank you for your comment! I appreciate the input and will have a look into those variables :D