summaryrefslogtreecommitdiffstats
path: root/src/input_common/drivers/gc_adapter.cpp
diff options
context:
space:
mode:
authorgerman77 <juangerman-13@hotmail.com>2021-11-21 21:12:01 +0100
committerNarr the Reg <juangerman-13@hotmail.com>2021-11-25 03:30:28 +0100
commit746c85b56011b87afb57e37b75953435389fc810 (patch)
tree32d31216be1450b5fbe9897e15829ff9bc1f1e7c /src/input_common/drivers/gc_adapter.cpp
parentinput_common: Fix SDL controller with inverted axis (diff)
downloadyuzu-746c85b56011b87afb57e37b75953435389fc810.tar
yuzu-746c85b56011b87afb57e37b75953435389fc810.tar.gz
yuzu-746c85b56011b87afb57e37b75953435389fc810.tar.bz2
yuzu-746c85b56011b87afb57e37b75953435389fc810.tar.lz
yuzu-746c85b56011b87afb57e37b75953435389fc810.tar.xz
yuzu-746c85b56011b87afb57e37b75953435389fc810.tar.zst
yuzu-746c85b56011b87afb57e37b75953435389fc810.zip
Diffstat (limited to 'src/input_common/drivers/gc_adapter.cpp')
-rw-r--r--src/input_common/drivers/gc_adapter.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/input_common/drivers/gc_adapter.cpp b/src/input_common/drivers/gc_adapter.cpp
index a1b9b6d98..8b6574223 100644
--- a/src/input_common/drivers/gc_adapter.cpp
+++ b/src/input_common/drivers/gc_adapter.cpp
@@ -481,47 +481,47 @@ AnalogMapping GCAdapter::GetAnalogMappingForDevice(const Common::ParamPackage& p
return mapping;
}
-std::string GCAdapter::GetUIButtonName(const Common::ParamPackage& params) const {
+Common::Input::ButtonNames GCAdapter::GetUIButtonName(const Common::ParamPackage& params) const {
PadButton button = static_cast<PadButton>(params.Get("button", 0));
switch (button) {
case PadButton::ButtonLeft:
- return "left";
+ return Common::Input::ButtonNames::ButtonLeft;
case PadButton::ButtonRight:
- return "right";
+ return Common::Input::ButtonNames::ButtonRight;
case PadButton::ButtonDown:
- return "down";
+ return Common::Input::ButtonNames::ButtonDown;
case PadButton::ButtonUp:
- return "up";
+ return Common::Input::ButtonNames::ButtonUp;
case PadButton::TriggerZ:
- return "Z";
+ return Common::Input::ButtonNames::TriggerZ;
case PadButton::TriggerR:
- return "R";
+ return Common::Input::ButtonNames::TriggerR;
case PadButton::TriggerL:
- return "L";
+ return Common::Input::ButtonNames::TriggerL;
case PadButton::ButtonA:
- return "A";
+ return Common::Input::ButtonNames::ButtonA;
case PadButton::ButtonB:
- return "B";
+ return Common::Input::ButtonNames::ButtonB;
case PadButton::ButtonX:
- return "X";
+ return Common::Input::ButtonNames::ButtonX;
case PadButton::ButtonY:
- return "Y";
+ return Common::Input::ButtonNames::ButtonY;
case PadButton::ButtonStart:
- return "start";
+ return Common::Input::ButtonNames::ButtonStart;
default:
- return "Unknown GC";
+ return Common::Input::ButtonNames::Undefined;
}
}
-std::string GCAdapter::GetUIName(const Common::ParamPackage& params) const {
+Common::Input::ButtonNames GCAdapter::GetUIName(const Common::ParamPackage& params) const {
if (params.Has("button")) {
- return fmt::format("Button {}", GetUIButtonName(params));
+ return GetUIButtonName(params);
}
if (params.Has("axis")) {
- return fmt::format("Axis {}", params.Get("axis", 0));
+ return Common::Input::ButtonNames::Value;
}
- return "Bad GC Adapter";
+ return Common::Input::ButtonNames::Invalid;
}
} // namespace InputCommon