Skip to main content

GamepadSettings Class

Configuration class for gamepad input normalization and axis behavior. More...

Declaration

class helios::input::gamepad::GamepadSettings { ... }

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...

floatleftStickDeadzone () const noexcept

Returns the configured deadzone for the left stick. More...

floatrightStickDeadzone () const noexcept

Returns the configured deadzone for the right stick. More...

boolinvertLeftX () const noexcept

Returns whether the left stick's X-axis is inverted. More...

boolinvertLeftY () const noexcept

Returns whether the left stick's Y-axis is inverted. More...

boolinvertRightX () const noexcept

Returns whether the right stick's X-axis is inverted. More...

boolinvertRightY () const noexcept

Returns whether the right stick's Y-axis is inverted. More...

Private Member Attributes Index

floatleftStickDeadzone_ = 0.0f

Deadzone threshold for the left analog stick. More...

floatrightStickDeadzone_ = 0.0f

Deadzone threshold for the right analog stick. More...

boolinvertLeftX_ = false

Flag to invert the left stick's X-axis. More...

boolinvertLeftY_ = false

Flag to invert the left stick's Y-axis. More...

boolinvertRightX_ = false

Flag to invert the right stick's X-axis. More...

boolinvertRightY_ = 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()

helios::input::gamepad::GamepadSettings::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()

helios::input::gamepad::GamepadSettings::~GamepadSettings ()
default

Default destructor.

Definition at line 74 of file GamepadSettings.ixx.

Public Member Functions

invertLeftX()

bool helios::input::gamepad::GamepadSettings::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.

178 [[nodiscard]] bool invertLeftX() const noexcept {
179 return invertLeftX_;
180 }

invertLeftY()

bool helios::input::gamepad::GamepadSettings::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.

187 [[nodiscard]] bool invertLeftY() const noexcept {
188 return invertLeftY_;
189 }

invertRightX()

bool helios::input::gamepad::GamepadSettings::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.

196 [[nodiscard]] bool invertRightX() const noexcept {
197 return invertRightX_;
198 }

invertRightY()

bool helios::input::gamepad::GamepadSettings::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.

205 [[nodiscard]] bool invertRightY() const noexcept {
206 return invertRightY_;
207 }

leftStickDeadzone()

float helios::input::gamepad::GamepadSettings::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.

160 [[nodiscard]] float leftStickDeadzone() const noexcept {
161 return leftStickDeadzone_;
162 }

rightStickDeadzone()

float helios::input::gamepad::GamepadSettings::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.

169 [[nodiscard]] float rightStickDeadzone() const noexcept {
170 return rightStickDeadzone_;
171 }

setInvertLeftX()

GamepadSettings & helios::input::gamepad::GamepadSettings::setInvertLeftX (bool invert)
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.

114 GamepadSettings& setInvertLeftX(bool invert) noexcept {
115 invertLeftX_ = invert;
116 return *this;
117 }

Reference GamepadSettings.

setInvertLeftY()

GamepadSettings & helios::input::gamepad::GamepadSettings::setInvertLeftY (bool invert)
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.

126 GamepadSettings& setInvertLeftY(bool invert) noexcept {
127 invertLeftY_ = invert;
128 return *this;
129 }

Reference GamepadSettings.

setInvertRightX()

GamepadSettings & helios::input::gamepad::GamepadSettings::setInvertRightX (bool invert)
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.

138 GamepadSettings& setInvertRightX(bool invert) noexcept {
139 invertRightX_ = invert;
140 return *this;
141 }

Reference GamepadSettings.

setInvertRightY()

GamepadSettings & helios::input::gamepad::GamepadSettings::setInvertRightY (bool invert)
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.

150 GamepadSettings& setInvertRightY(bool invert) noexcept {
151 invertRightY_ = invert;
152 return *this;
153 }

Reference GamepadSettings.

setLeftStickDeadzone()

GamepadSettings & helios::input::gamepad::GamepadSettings::setLeftStickDeadzone (float deadzone)
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.

88 GamepadSettings& setLeftStickDeadzone(float deadzone) noexcept {
89 deadzone = std::clamp(deadzone, 0.0f, 0.9f);
90 leftStickDeadzone_ = deadzone;
91 return *this;
92 }

Reference GamepadSettings.

setRightStickDeadzone()

GamepadSettings & helios::input::gamepad::GamepadSettings::setRightStickDeadzone (float deadzone)
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.

101 GamepadSettings& setRightStickDeadzone(float deadzone) noexcept {
102 deadzone = std::clamp(deadzone, 0.0f, 0.9f);
103 rightStickDeadzone_ = deadzone;
104 return *this;
105 }

Reference GamepadSettings.

Private Member Attributes

invertLeftX_

bool helios::input::gamepad::GamepadSettings::invertLeftX_ = false

Flag to invert the left stick's X-axis.

Definition at line 52 of file GamepadSettings.ixx.

52 bool invertLeftX_ = false;

invertLeftY_

bool helios::input::gamepad::GamepadSettings::invertLeftY_ = false

Flag to invert the left stick's Y-axis.

Definition at line 57 of file GamepadSettings.ixx.

57 bool invertLeftY_ = false;

invertRightX_

bool helios::input::gamepad::GamepadSettings::invertRightX_ = false

Flag to invert the right stick's X-axis.

Definition at line 62 of file GamepadSettings.ixx.

62 bool invertRightX_ = false;

invertRightY_

bool helios::input::gamepad::GamepadSettings::invertRightY_ = false

Flag to invert the right stick's Y-axis.

Definition at line 67 of file GamepadSettings.ixx.

67 bool invertRightY_ = false;

leftStickDeadzone_

float helios::input::gamepad::GamepadSettings::leftStickDeadzone_ = 0.0f

Deadzone threshold for the left analog stick.

Definition at line 42 of file GamepadSettings.ixx.

42 float leftStickDeadzone_ = 0.0f;

rightStickDeadzone_

float helios::input::gamepad::GamepadSettings::rightStickDeadzone_ = 0.0f

Deadzone threshold for the right analog stick.

Definition at line 47 of file GamepadSettings.ixx.

47 float rightStickDeadzone_ = 0.0f;

The documentation for this class was generated from the following file:


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.