Trouble with binding Xinput buttons as keyboard key and vice versa

Ask gaming related questions (AHK v1.1 and older)
EndlessApollo
Posts: 1
Joined: 20 May 2022, 17:05

Trouble with binding Xinput buttons as keyboard key and vice versa

Post by EndlessApollo » 20 May 2022, 18:11

I'm weird and I like playing fighting games with keyboard keys (ASDSpace) plus buttons on my arcade stick. Most games give me no trouble with it. However, some fighting games will block controller inputs while a key is being pressed, or require you to register exactly one controller/keyboard per player. I tried getting around this by using the following script to bind Xinput buttons to keyboard presses:

Code: Select all

Joy1::
Send {j down}
SetTimer, WaitForButtonUp1, 10
return

WaitForButtonUp1:
if GetKeyState("Joy1")
    return
Send {j up}
SetTimer, WaitForButtonUp1, Off
return
(repeat for each button on my stick)

This is mostly functional, but has a couple major problems:
1. The script doesn't override or block the buttons on the stick, so games will detect both the Xinput button press and the key press. This means it's random whether the Xinput press or keyboard press is read first, which leads to issues in games where the ingame Xinput binding differs from the binding in my script, which i believe can be worked around but is still annoying.
2. For some reason, button combinations seem to be way harder/impossible to input. This means i can't reliably use moves that require a button combination. I'm not sure what's causing this, but i suspect that it has to do with either a bit of input delay with my script/AutoHotKey in general, or that my script has trouble reading simultanious button presses.

I've tried simpler scripts, like

Code: Select all

Joy1::u
That doesn't work in games where keys block button inputs though. I tested in King of Fighters 13, and the game still only reads the Xinput buttons.

2 is the far larger issue, but help with either would be much appreciated! If the cause of the second problem is build in random input delay from AHK however, i'll just have to ditch the idea and try something else/relearn how to use stick. Random input delay in fighting games with tight/frame perfect inputs isn't acceptable. A way to bind keyboard keys to Xinput joystick values would likely also fix most/all of my issues, but I haven't found a way to do that online, or if I have I'm too new to AHK to recognize it

Update: I decided to just use reWASD instead. There's a tiny bit of input delay, but it's significantly less than a frame so it should be fine. It's definitely been working better than my AHK attempts

Return to “Gaming Help (v1)”