From 03aaf7db6aca5ff8dca23cf4fd8e2fe2b177ec47 Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Fri, 28 Nov 2025 17:59:03 +0000 Subject: [PATCH] SDLInputSource: Support full axis binds of gamepad axes --- pcsx2/Input/SDLInputSource.cpp | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/pcsx2/Input/SDLInputSource.cpp b/pcsx2/Input/SDLInputSource.cpp index 8a300a3468..556b34c8c1 100644 --- a/pcsx2/Input/SDLInputSource.cpp +++ b/pcsx2/Input/SDLInputSource.cpp @@ -870,10 +870,10 @@ std::optional SDLInputSource::ParseKeyString(const std::string_ key.data = 0; return key; } - else if (binding[0] == '+' || binding[0] == '-') + else if (binding[0] == '+' || binding[0] == '-' || binding.starts_with("Full")) { // likely an axis - const std::string_view axis_name(binding.substr(1)); + const std::string_view axis_name(binding.substr(binding[0] == 'F' ? 4 : 1)); if (axis_name.starts_with("JoyAxis")) { @@ -882,7 +882,9 @@ std::optional SDLInputSource::ParseKeyString(const std::string_ { key.source_subtype = InputSubclass::ControllerAxis; key.data = *value + std::size(s_sdl_axis_setting_names); - key.modifier = (binding[0] == '-') ? InputModifier::Negate : InputModifier::None; + key.modifier = (binding[0] == 'F') ? InputModifier::FullAxis : + (binding[0] == '-') ? InputModifier::Negate : + InputModifier::None; key.invert = (end == "~"); return key; } @@ -894,23 +896,13 @@ std::optional SDLInputSource::ParseKeyString(const std::string_ // found an axis! key.source_subtype = InputSubclass::ControllerAxis; key.data = i; - key.modifier = (binding[0] == '-') ? InputModifier::Negate : InputModifier::None; + key.modifier = (binding[0] == 'F') ? InputModifier::FullAxis : + (binding[0] == '-') ? InputModifier::Negate : + InputModifier::None; return key; } } } - else if (binding.starts_with("FullJoyAxis")) - { - std::string_view end; - if (auto value = StringUtil::FromChars(binding.substr(11), 10, &end)) - { - key.source_subtype = InputSubclass::ControllerAxis; - key.data = *value + std::size(s_sdl_axis_setting_names); - key.modifier = InputModifier::FullAxis; - key.invert = (end == "~"); - return key; - } - } else if (binding.starts_with("Hat")) { std::string_view hat_dir;