Invert xinput button state

Ask gaming related questions (AHK v1.1 and older)
razgriz97
Posts: 3
Joined: 09 Aug 2019, 18:11

Invert xinput button state

25 Oct 2019, 20:44

Hi,

Since yesterday I'm trying figure how to make my Xbox One Controller to invert the state of the button X. By invert I mean, when the button is not physically pressed by me the game see as it's pressed and vice versa. The reason behind this is I'm playing old Megaman X games and want to autocharge the shot.

I've came out with this very simple code, but since xinput buttons cannot be used as Hotkeys directly I'm struggling to think a way around.

Code: Select all

XInput_Init()
Loop {
  if (!getKeyState(XINPUT_GAMEPAD_X))
  Send, {XINPUT_GAMEPAD_X Down}
  else
  Send, {XINPUT_GAMEPAD_X Up}
}
Any help would be appreciated :)

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 34 guests