![]() |
NDEVR
API Documentation
|
Provides a ControllerInterface implementation for Xbox controllers using the XInput API. More...
Public Member Functions | |
| XBoxController (uint04 index) | |
| Constructs an XBoxController for the given XInput device index. | |
| virtual Buffer< Battery * > | batteries () const override |
| Returns the battery objects associated with this controller. | |
| virtual Buffer< ControlButton > | centerButtons () const override |
| Returns the center button states (e.g., start, back, guide). | |
| virtual RGBColor | color () const |
| Returns the current color of the controller. | |
| Buffer< HapticFeedback > | hapticFeedback () const override |
| Returns haptic feedback capabilities. | |
| virtual UUID | id () const override |
| Returns the unique identifier for this controller. | |
| virtual Buffer< ControlButton > | leftButtons () const override |
| Returns the left-side button states. | |
| virtual Buffer< ControlStick > | leftSticks () const override |
| Returns the left analog stick state. | |
| virtual Buffer< ControlTrigger > | leftTriggers () const override |
| Returns the left trigger state. | |
| virtual bool | requestColor (const RGBColor &color) override |
| Requests a color change on the controller (not supported on Xbox controllers). | |
| virtual bool | requestVibrating (fltp08 left, fltp08 right) override |
| Requests vibration on the controller motors. | |
| virtual Buffer< ControlButton > | rightButtons () const override |
| Returns the right-side button states. | |
| virtual Buffer< ControlStick > | rightSticks () const override |
| Returns the right analog stick state. | |
| virtual Buffer< ControlTrigger > | rightTriggers () const override |
| Returns the right trigger state. | |
| void | updateBattery () |
| Updates the battery status information for this controller. | |
| void | updateState () override |
| Polls the controller for the latest input state. | |
| virtual Vector< 2, fltp08 > | vibration () const override |
| Returns the current vibration intensity for left and right motors. | |
| Public Member Functions inherited from ControllerInterface | |
| void | onUpdated () |
| Emitted after the controller state has been updated. | |
| virtual void | setWindowInstance (WindowInstance *) |
| Associates a window instance with this controller for input routing. | |
Protected Attributes | |
| uint04 | failure_count = 0 |
| Consecutive polling failure count. | |
| Battery * | m_battery |
| The battery associated with this controller. | |
| bool | m_has_battery = true |
| Whether this controller reports battery information. | |
| UUID | m_id |
| The unique identifier for this controller instance. | |
| uint04 | m_index |
| The XInput device index (0-3). | |
| XINPUT_STATE | m_input_state |
| The current input state from XInput. | |
| bool | m_needs_input_update = false |
| Whether the input state needs to be refreshed. | |
| XINPUT_VIBRATION | m_output_state |
| The current vibration output state. | |
Provides a ControllerInterface implementation for Xbox controllers using the XInput API.
Definition at line 15 of file XInputFactory.h.
| XBoxController::XBoxController | ( | uint04 | index | ) |
Constructs an XBoxController for the given XInput device index.
| [in] | index | The XInput controller index (0-3). |
Returns the battery objects associated with this controller.
Implements ControllerInterface.
|
overridevirtual |
Returns the center button states (e.g., start, back, guide).
Implements ControllerInterface.
|
virtual |
Returns the current color of the controller.
Implements ControllerInterface.
Referenced by requestColor().
|
overridevirtual |
Returns haptic feedback capabilities.
Implements ControllerInterface.
|
overridevirtual |
Returns the unique identifier for this controller.
Implements ControllerInterface.
|
overridevirtual |
Returns the left-side button states.
Implements ControllerInterface.
|
overridevirtual |
Returns the left analog stick state.
Implements ControllerInterface.
|
overridevirtual |
Returns the left trigger state.
Implements ControllerInterface.
|
overridevirtual |
Requests a color change on the controller (not supported on Xbox controllers).
| [in] | color | The requested RGB color. |
Implements ControllerInterface.
References color().
Requests vibration on the controller motors.
| [in] | left | Left motor intensity, 0 = off, 1 = full vibration. |
| [in] | right | Right motor intensity, 0 = off, 1 = full vibration. |
Implements ControllerInterface.
|
overridevirtual |
Returns the right-side button states.
Implements ControllerInterface.
|
overridevirtual |
Returns the right analog stick state.
Implements ControllerInterface.
|
overridevirtual |
Returns the right trigger state.
Implements ControllerInterface.
Returns the current vibration intensity for left and right motors.
Implements ControllerInterface.