GamepadSettings Class
Configuration class for gamepad input normalization and axis behavior. More...
Declaration
Public Constructors Index
| GamepadSettings ()=default | |
|
Default constructor with zero deadzone and no axis inversion. More... | |
Public Destructor Index
| ~GamepadSettings ()=default | |
|
Default destructor. More... | |
Public Member Functions Index
| GamepadSettings & | setLeftStickDeadzone (float deadzone) noexcept |
|
Sets the deadzone threshold for the left analog stick. More... | |
| GamepadSettings & | setRightStickDeadzone (float deadzone) noexcept |
|
Sets the deadzone threshold for the right analog stick. More... | |
| GamepadSettings & | setInvertLeftX (bool invert) noexcept |
|
Sets whether the left stick's X-axis should be inverted. More... | |
| GamepadSettings & | setInvertLeftY (bool invert) noexcept |
|
Sets whether the left stick's Y-axis should be inverted. More... | |
| GamepadSettings & | setInvertRightX (bool invert) noexcept |
|
Sets whether the right stick's X-axis should be inverted. More... | |
| GamepadSettings & | setInvertRightY (bool invert) noexcept |
|
Sets whether the right stick's Y-axis should be inverted. More... | |
| float | leftStickDeadzone () const noexcept |
|
Returns the configured deadzone for the left stick. More... | |
| float | rightStickDeadzone () const noexcept |
|
Returns the configured deadzone for the right stick. More... | |
| bool | invertLeftX () const noexcept |
|
Returns whether the left stick's X-axis is inverted. More... | |
| bool | invertLeftY () const noexcept |
|
Returns whether the left stick's Y-axis is inverted. More... | |
| bool | invertRightX () const noexcept |
|
Returns whether the right stick's X-axis is inverted. More... | |
| bool | invertRightY () const noexcept |
|
Returns whether the right stick's Y-axis is inverted. More... | |
Private Member Attributes Index
| float | leftStickDeadzone_ = 0.0f |
|
Deadzone threshold for the left analog stick. More... | |
| float | rightStickDeadzone_ = 0.0f |
|
Deadzone threshold for the right analog stick. More... | |
| bool | invertLeftX_ = false |
|
Flag to invert the left stick's X-axis. More... | |
| bool | invertLeftY_ = false |
|
Flag to invert the left stick's Y-axis. More... | |
| bool | invertRightX_ = false |
|
Flag to invert the right stick's X-axis. More... | |
| bool | invertRightY_ = false |
|
Flag to invert the right stick's Y-axis. More... | |
Description
Configuration class for gamepad input normalization and axis behavior.
This class encapsulates all settings that affect how raw gamepad input is processed before being consumed by the application. It provides fluent setter methods for convenient method chaining during configuration.
**Configurable options:**
- **Deadzone values:** Per-stick thresholds for filtering out hardware drift.
- **Axis inversion:** Individual control over X/Y axis inversion for both sticks.
Deadzone values are clamped to the range [0.0, 0.9] to ensure that at least 10% of the stick's range remains usable.
Example usage: ```cpp GamepadSettings settings; settings.setLeftStickDeadzone(0.15f) .setRightStickDeadzone(0.1f) .setInvertLeftY(true); ```
- See Also
DeadzoneStrategy for how deadzone values are applied during normalization.
Definition at line 37 of file GamepadSettings.ixx.
Public Constructors
GamepadSettings()
| default |
Default constructor with zero deadzone and no axis inversion.
Definition at line 79 of file GamepadSettings.ixx.
Referenced by setInvertLeftX, setInvertLeftY, setInvertRightX, setInvertRightY, setLeftStickDeadzone and setRightStickDeadzone.
Public Destructor
~GamepadSettings()
| default |
Default destructor.
Definition at line 74 of file GamepadSettings.ixx.
Public Member Functions
invertLeftX()
| inline nodiscard noexcept |
Returns whether the left stick's X-axis is inverted.
- Returns
True if inverted, false otherwise.
Definition at line 178 of file GamepadSettings.ixx.
invertLeftY()
| inline nodiscard noexcept |
Returns whether the left stick's Y-axis is inverted.
- Returns
True if inverted, false otherwise.
Definition at line 187 of file GamepadSettings.ixx.
invertRightX()
| inline nodiscard noexcept |
Returns whether the right stick's X-axis is inverted.
- Returns
True if inverted, false otherwise.
Definition at line 196 of file GamepadSettings.ixx.
invertRightY()
| inline nodiscard noexcept |
Returns whether the right stick's Y-axis is inverted.
- Returns
True if inverted, false otherwise.
Definition at line 205 of file GamepadSettings.ixx.
leftStickDeadzone()
| inline nodiscard noexcept |
Returns the configured deadzone for the left stick.
- Returns
The deadzone threshold in the range [0.0, 0.9].
Definition at line 160 of file GamepadSettings.ixx.
rightStickDeadzone()
| inline nodiscard noexcept |
Returns the configured deadzone for the right stick.
- Returns
The deadzone threshold in the range [0.0, 0.9].
Definition at line 169 of file GamepadSettings.ixx.
setInvertLeftX()
| inline noexcept |
Sets whether the left stick's X-axis should be inverted.
- Parameters
-
invert True to invert, false for normal behavior.
- Returns
Reference to this object for method chaining.
Definition at line 114 of file GamepadSettings.ixx.
Reference GamepadSettings.
setInvertLeftY()
| inline noexcept |
Sets whether the left stick's Y-axis should be inverted.
- Parameters
-
invert True to invert, false for normal behavior.
- Returns
Reference to this object for method chaining.
Definition at line 126 of file GamepadSettings.ixx.
Reference GamepadSettings.
setInvertRightX()
| inline noexcept |
Sets whether the right stick's X-axis should be inverted.
- Parameters
-
invert True to invert, false for normal behavior.
- Returns
Reference to this object for method chaining.
Definition at line 138 of file GamepadSettings.ixx.
Reference GamepadSettings.
setInvertRightY()
| inline noexcept |
Sets whether the right stick's Y-axis should be inverted.
- Parameters
-
invert True to invert, false for normal behavior.
- Returns
Reference to this object for method chaining.
Definition at line 150 of file GamepadSettings.ixx.
Reference GamepadSettings.
setLeftStickDeadzone()
| inline noexcept |
Sets the deadzone threshold for the left analog stick.
- Parameters
-
deadzone The deadzone value, clamped to [0.0, 0.9].
- Returns
Reference to this object for method chaining.
Definition at line 88 of file GamepadSettings.ixx.
Reference GamepadSettings.
setRightStickDeadzone()
| inline noexcept |
Sets the deadzone threshold for the right analog stick.
- Parameters
-
deadzone The deadzone value, clamped to [0.0, 0.9].
- Returns
Reference to this object for method chaining.
Definition at line 101 of file GamepadSettings.ixx.
Reference GamepadSettings.
Private Member Attributes
invertLeftX_
|
Flag to invert the left stick's X-axis.
Definition at line 52 of file GamepadSettings.ixx.
invertLeftY_
|
Flag to invert the left stick's Y-axis.
Definition at line 57 of file GamepadSettings.ixx.
invertRightX_
|
Flag to invert the right stick's X-axis.
Definition at line 62 of file GamepadSettings.ixx.
invertRightY_
|
Flag to invert the right stick's Y-axis.
Definition at line 67 of file GamepadSettings.ixx.
leftStickDeadzone_
|
Deadzone threshold for the left analog stick.
Definition at line 42 of file GamepadSettings.ixx.
rightStickDeadzone_
|
Deadzone threshold for the right analog stick.
Definition at line 47 of file GamepadSettings.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.