XINPUTSTATE
XINPUT_STATE is a data structure used by the Windows XInput API to report the current state of a connected gamepad. It is filled by the function XInputGetState and is commonly used by games and input libraries to poll the controller.
The XINPUT_STATE structure contains two members: dwPacketNumber and Gamepad. The dwPacketNumber is a monotonically increasing value
XINPUT_GAMEPAD includes the following fields: wButtons, bLeftTrigger, bRightTrigger, sThumbLX, sThumbLY, sThumbRX, and sThumbRY. The wButtons field
Button mappings are defined as constants in the API (for example, XINPUT_GAMEPAD_A, XINPUT_GAMEPAD_B, XINPUT_GAMEPAD_X, XINPUT_GAMEPAD_Y, and
XInputGetState is called with a user index (0 to 3) to retrieve an XINPUT_STATE for up to