summaryrefslogtreecommitdiff
path: root/src/input_common/sdl/sdl_impl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/input_common/sdl/sdl_impl.cpp')
-rw-r--r--src/input_common/sdl/sdl_impl.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/input_common/sdl/sdl_impl.cpp b/src/input_common/sdl/sdl_impl.cpp
index 68672a92b..2f7ccdd37 100644
--- a/src/input_common/sdl/sdl_impl.cpp
+++ b/src/input_common/sdl/sdl_impl.cpp
@@ -660,7 +660,8 @@ public:
660 660
661 if (params.Has("axis")) { 661 if (params.Has("axis")) {
662 const int axis = params.Get("axis", 0); 662 const int axis = params.Get("axis", 0);
663 const float threshold = params.Get("threshold", 0.5f); 663 // Convert range from (0.0, 1.0) to (-1.0, 1.0)
664 const float threshold = (params.Get("threshold", 0.5f) - 0.5f) * 2.0f;
664 const std::string direction_name = params.Get("direction", ""); 665 const std::string direction_name = params.Get("direction", "");
665 bool trigger_if_greater; 666 bool trigger_if_greater;
666 if (direction_name == "+") { 667 if (direction_name == "+") {
@@ -933,12 +934,11 @@ Common::ParamPackage BuildAnalogParamPackageForButton(int port, std::string guid
933 params.Set("port", port); 934 params.Set("port", port);
934 params.Set("guid", std::move(guid)); 935 params.Set("guid", std::move(guid));
935 params.Set("axis", axis); 936 params.Set("axis", axis);
937 params.Set("threshold", "0.5");
936 if (value > 0) { 938 if (value > 0) {
937 params.Set("direction", "+"); 939 params.Set("direction", "+");
938 params.Set("threshold", "0.5");
939 } else { 940 } else {
940 params.Set("direction", "-"); 941 params.Set("direction", "-");
941 params.Set("threshold", "-0.5");
942 } 942 }
943 return params; 943 return params;
944} 944}