summaryrefslogtreecommitdiff
path: root/src/input_common/input_mapping.cpp
diff options
context:
space:
mode:
authorGravatar german772021-11-21 14:12:01 -0600
committerGravatar Narr the Reg2021-11-24 20:30:28 -0600
commit746c85b56011b87afb57e37b75953435389fc810 (patch)
tree32d31216be1450b5fbe9897e15829ff9bc1f1e7c /src/input_common/input_mapping.cpp
parentinput_common: Fix SDL controller with inverted axis (diff)
downloadyuzu-746c85b56011b87afb57e37b75953435389fc810.tar.gz
yuzu-746c85b56011b87afb57e37b75953435389fc810.tar.xz
yuzu-746c85b56011b87afb57e37b75953435389fc810.zip
input_common: Move button names to the frontend
Diffstat (limited to 'src/input_common/input_mapping.cpp')
-rw-r--r--src/input_common/input_mapping.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/input_common/input_mapping.cpp b/src/input_common/input_mapping.cpp
index 0eeeff372..c5218f2cb 100644
--- a/src/input_common/input_mapping.cpp
+++ b/src/input_common/input_mapping.cpp
@@ -61,6 +61,7 @@ void MappingFactory::RegisterButton(const MappingData& data) {
61 } 61 }
62 new_input.Set("port", static_cast<int>(data.pad.port)); 62 new_input.Set("port", static_cast<int>(data.pad.port));
63 new_input.Set("pad", static_cast<int>(data.pad.pad)); 63 new_input.Set("pad", static_cast<int>(data.pad.pad));
64
64 switch (data.type) { 65 switch (data.type) {
65 case EngineInputType::Button: 66 case EngineInputType::Button:
66 // Workaround for old compatibility 67 // Workaround for old compatibility
@@ -75,6 +76,10 @@ void MappingFactory::RegisterButton(const MappingData& data) {
75 new_input.Set("direction", data.hat_name); 76 new_input.Set("direction", data.hat_name);
76 break; 77 break;
77 case EngineInputType::Analog: 78 case EngineInputType::Analog:
79 // Ignore mouse axis when mapping buttons
80 if (data.engine == "mouse") {
81 return;
82 }
78 new_input.Set("axis", data.index); 83 new_input.Set("axis", data.index);
79 new_input.Set("threshold", 0.5f); 84 new_input.Set("threshold", 0.5f);
80 break; 85 break;