From aea9f5b966d4f0d80f1b897061d6150d2475faf2 Mon Sep 17 00:00:00 2001 From: Tillsunset <35825944+Tillsunset@users.noreply.github.com> Date: Tue, 13 Dec 2022 22:41:48 -0600 Subject: [PATCH] Fix SDL controller reversed y axis in UI (#574) --- src/gui/input/settings/DefaultControllerSettings.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gui/input/settings/DefaultControllerSettings.cpp b/src/gui/input/settings/DefaultControllerSettings.cpp index 678a792d..97cf1704 100644 --- a/src/gui/input/settings/DefaultControllerSettings.cpp +++ b/src/gui/input/settings/DefaultControllerSettings.cpp @@ -248,6 +248,12 @@ void DefaultControllerSettings::on_timer(wxTimerEvent& event) m_controller->apply_axis_setting(state.rotation, default_state.rotation, m_settings.rotation); m_controller->apply_axis_setting(state.trigger, default_state.trigger, m_settings.trigger); + if (m_controller->api() == InputAPI::SDLController) + { + state.axis.y *= -1; + state.rotation.y *= -1; + } + m_axis_draw->SetDeadzone(m_settings.axis.deadzone); m_axis_draw->SetAxisValue(state.axis);