Skip to content

Library Global XInput

Gabriel edited this page Sep 26, 2023 · 1 revision

XInput

Provides XInput capabilities.

Members;

  • XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE - the left analog stick's manufacturing deadzone.
  • XINPUT_GAMEPAD_RIGHT_THUMB_DEADZONE - the right analog stick's manufacturing deadzone.

Functions;

  • extern int XInputGetState(int in_dwUserIndex, ref State in_pState) - returns the current XInput state.
  • extern int XInputSetState(int in_dwUserIndex, ref Vibration in_pVibration) - sets the current XInput state (used for vibration).
  • State? GetState() - returns the current XInput state.
  • void SetState(Vibration in_vibration) - sets the current XInput state (used for vibration).
  • Vector2 GetAnalog(int in_analogIndex, bool in_isTestDeadzone = true) - returns the analog stick at the specified index.
  • bool IsButtonDown(Buttons in_buttons) - determines whether a button is being held down.
  • float GetTrigger(int in_triggerIndex) - returns the trigger at the specified index.
  • bool IsAnalogNeutral(int in_analogIndex) - determines whether the analog stick at the specified index is at its neutral position.
  • Vibration GetVibration() - returns a Vibration struct containing the left and right motor speeds.
  • void SetVibration(float in_value) - sets the amount of vibration of both motors to the input value.
  • void SetVibration(int in_motorIndex, float in_value) - sets the amount of vibration of the specified motor to the input value.

Types;

  • enum Buttons - an enum containing each controller button flag.
  • struct State - a struct representation of XINPUT_STATE from xinput.h.
  • struct Gamepad - a struct representation of XINPUT_GAMEPAD from xinput.h.
  • struct Vibration - a struct representation of XINPUT_VIBRATION from xinput.h.
Clone this wiki locally