diff options
Diffstat (limited to '')
-rwxr-xr-x | src/input_common/analog_from_button.cpp | 4 | ||||
-rw-r--r-- | src/input_common/gcadapter/gc_poller.cpp | 10 | ||||
-rw-r--r-- | src/input_common/mouse/mouse_poller.cpp | 10 | ||||
-rw-r--r-- | src/input_common/sdl/sdl_impl.cpp | 10 |
4 files changed, 34 insertions, 0 deletions
diff --git a/src/input_common/analog_from_button.cpp b/src/input_common/analog_from_button.cpp index 07a0fa4a1..770893687 100755 --- a/src/input_common/analog_from_button.cpp +++ b/src/input_common/analog_from_button.cpp @@ -139,6 +139,10 @@ public: static_cast<float>(y) * coef * (x == 0 ? 1.0f : SQRT_HALF)); } + Input::AnalogProperties GetAnalogProperties() const override { + return {modifier_scale, 1.0f, 0.5f}; + } + bool GetAnalogDirectionStatus(Input::AnalogDirection direction) const override { switch (direction) { case Input::AnalogDirection::RIGHT: diff --git a/src/input_common/gcadapter/gc_poller.cpp b/src/input_common/gcadapter/gc_poller.cpp index 9670bdeb2..1b6ded8d6 100644 --- a/src/input_common/gcadapter/gc_poller.cpp +++ b/src/input_common/gcadapter/gc_poller.cpp @@ -185,6 +185,16 @@ public: return {0.0f, 0.0f}; } + std::tuple<float, float> GetRawStatus() const override { + const float x = GetAxis(axis_x); + const float y = GetAxis(axis_y); + return {x, y}; + } + + Input::AnalogProperties GetAnalogProperties() const override { + return {deadzone, range, 0.5f}; + } + bool GetAnalogDirectionStatus(Input::AnalogDirection direction) const override { const auto [x, y] = GetStatus(); const float directional_deadzone = 0.5f; diff --git a/src/input_common/mouse/mouse_poller.cpp b/src/input_common/mouse/mouse_poller.cpp index 508eb0c7d..3d799b293 100644 --- a/src/input_common/mouse/mouse_poller.cpp +++ b/src/input_common/mouse/mouse_poller.cpp @@ -106,6 +106,16 @@ public: return {0.0f, 0.0f}; } + std::tuple<float, float> GetRawStatus() const override { + const float x = GetAxis(axis_x); + const float y = GetAxis(axis_y); + return {x, y}; + } + + Input::AnalogProperties GetAnalogProperties() const override { + return {deadzone, range, 0.5f}; + } + private: const u32 button; const u32 axis_x; diff --git a/src/input_common/sdl/sdl_impl.cpp b/src/input_common/sdl/sdl_impl.cpp index 1b5750937..f67de37e3 100644 --- a/src/input_common/sdl/sdl_impl.cpp +++ b/src/input_common/sdl/sdl_impl.cpp @@ -377,6 +377,16 @@ public: return {}; } + std::tuple<float, float> GetRawStatus() const override { + const float x = joystick->GetAxis(axis_x, range); + const float y = joystick->GetAxis(axis_y, range); + return {x, -y}; + } + + Input::AnalogProperties GetAnalogProperties() const override { + return {deadzone, range, 0.5f}; + } + bool GetAnalogDirectionStatus(Input::AnalogDirection direction) const override { const auto [x, y] = GetStatus(); const float directional_deadzone = 0.5f; |