
- 'Pressed' - Return true if pressed, false if not - Return true if stick is inside deadzone, false if outsideįloat LeftStick_X() // Return X axis of left stickįloat LeftStick_Y() // Return Y axis of left stickįloat RightStick_X() // Return X axis of right stickįloat RightStick_Y() // Return Y axis of right stickįloat LeftTrigger() // Return value of left triggerįloat RightTrigger() // Return value of right trigger ‘ Gamepad.h‘ should now look similar to this: Let’s externally define the ‘ XButtonIDs‘ struct as ‘ XButtons‘ at the bottom of ‘ Gamepad.h‘ – to make it easily accessible for specifying buttons in button-based functions, and while we’re at it, we’ll add the function prototype for the ‘Get ButtonPressed‘ function. The ‘ XINPUT_Buttons‘ array contains the XInput values (which are really just hexadecimal values) for all the buttons we’re supporting and the order of the values in the array matches the order of the values in the ‘ XButtonIDs‘ struct (you’ll soon see why).

Int DPad_Up, DPad_Down, DPad_Left, DPad_Right Before we can get to that, we need to add an array of all the button values we want to use (fortunately XInput provides values for us) and a set of identifiers we can use to index the array.Īdd the following above the ‘ Gamepad‘ class in ‘ Gamepad.h‘: We’ll start with a basic check of ‘Get ButtonPressed‘, a boolean function which returns true if the specified button is pressed or false, if the button is not pressed. XInput does not seem to offer support for the ‘Guide’ (Xbox logo) button, but we’re going to make use of all the others – the A,B,X,Y ‘action’ buttons, the D-Pad, the BACK and START buttons and even the thumbstick buttons (clicking in/down the thumbsticks). The last (but definitely not least) feature we need to add to the ‘ Gamepad‘ class to make it complete, is the ability to obtain input from the various buttons. Return to Part 1 Return to Part 2 Basic Button Input: Before we begin, if you’re reading this and haven’t yet read one or both previous parts of the tutorial, it may be worth your while to go read the part(s) you missed. PD: Remember that the first screen of the game, the blue one with the controls, have to be skipped with the keyboard "X", then you can play the entire game with the controller.Welcome to the third and final part of my tutorial on gamepad input using C++ and XInput. The last step is to configure the controller controls on the launcher the same way as the rest of versions of the game: Something you should to take into account that Final Fantasy VII only accepts DInput controllers with up to 10 buttons, which means that with this configuration we will lose the ability to use LS and RS(元 and R3) in this game, the original layout didn't use them anyways thoght.įinally just click "Apply" and the changes should be effective the next time you boot the game. This will make the D-Pad work as the Left Stick, that way you can move and navigate the menus with both the D-Pad and the Left Stick.Īs for the triggers, go to the "DirectInput" tab and tick "Enable DirectInput Output", then click on "Customize" and we would make the next changes: To make the D-Pad work go to the first tab of XInputPlus, "KeyAssing" and in the "Left Stick" box select "Multiple Key", then tick "Left Stick" and "DPAD" and click "Ok". Then extract the program and run it as Administrator and select the Final Fantasy VII executable found in "C:/Program FIles(x86)/Steam/SteamApps/Common/FINAL FANTASY VII/ff7.exe".

XINPUT TEST PROGRAM DOWNLOAD
If the file link is down, you just don't want trust this guide enough to download it, or just want to configure some options by yourself you can just follow these steps:įirst of all download XInputPlus, the page is in Japanese, but the program is in english, just click on the latest version of XinputPlus to download ti.
