diff options
| author | 2021-11-21 14:12:01 -0600 | |
|---|---|---|
| committer | 2021-11-24 20:30:28 -0600 | |
| commit | 746c85b56011b87afb57e37b75953435389fc810 (patch) | |
| tree | 32d31216be1450b5fbe9897e15829ff9bc1f1e7c /src/input_common/drivers/sdl_driver.cpp | |
| parent | input_common: Fix SDL controller with inverted axis (diff) | |
| download | yuzu-746c85b56011b87afb57e37b75953435389fc810.tar.gz yuzu-746c85b56011b87afb57e37b75953435389fc810.tar.xz yuzu-746c85b56011b87afb57e37b75953435389fc810.zip | |
input_common: Move button names to the frontend
Diffstat (limited to 'src/input_common/drivers/sdl_driver.cpp')
| -rw-r--r-- | src/input_common/drivers/sdl_driver.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/input_common/drivers/sdl_driver.cpp b/src/input_common/drivers/sdl_driver.cpp index d5af6c09b..90128b6cf 100644 --- a/src/input_common/drivers/sdl_driver.cpp +++ b/src/input_common/drivers/sdl_driver.cpp | |||
| @@ -869,26 +869,25 @@ MotionMapping SDLDriver::GetMotionMappingForDevice(const Common::ParamPackage& p | |||
| 869 | return mapping; | 869 | return mapping; |
| 870 | } | 870 | } |
| 871 | 871 | ||
| 872 | std::string SDLDriver::GetUIName(const Common::ParamPackage& params) const { | 872 | Common::Input::ButtonNames SDLDriver::GetUIName(const Common::ParamPackage& params) const { |
| 873 | if (params.Has("button")) { | 873 | if (params.Has("button")) { |
| 874 | // TODO(German77): Find how to substitue the values for real button names | 874 | // TODO(German77): Find how to substitue the values for real button names |
| 875 | return fmt::format("Button {}", params.Get("button", 0)); | 875 | return Common::Input::ButtonNames::Value; |
| 876 | } | 876 | } |
| 877 | if (params.Has("hat")) { | 877 | if (params.Has("hat")) { |
| 878 | return fmt::format("Hat {}", params.Get("direction", "")); | 878 | return Common::Input::ButtonNames::Value; |
| 879 | } | 879 | } |
| 880 | if (params.Has("axis")) { | 880 | if (params.Has("axis")) { |
| 881 | return fmt::format("Axis {}", params.Get("axis", "")); | 881 | return Common::Input::ButtonNames::Value; |
| 882 | } | 882 | } |
| 883 | if (params.Has("axis_x") && params.Has("axis_y") && params.Has("axis_z")) { | 883 | if (params.Has("axis_x") && params.Has("axis_y") && params.Has("axis_z")) { |
| 884 | return fmt::format("Axis {},{},{}", params.Get("axis_x", ""), params.Get("axis_y", ""), | 884 | return Common::Input::ButtonNames::Value; |
| 885 | params.Get("axis_z", "")); | ||
| 886 | } | 885 | } |
| 887 | if (params.Has("motion")) { | 886 | if (params.Has("motion")) { |
| 888 | return "SDL motion"; | 887 | return Common::Input::ButtonNames::Engine; |
| 889 | } | 888 | } |
| 890 | 889 | ||
| 891 | return "Bad SDL"; | 890 | return Common::Input::ButtonNames::Invalid; |
| 892 | } | 891 | } |
| 893 | 892 | ||
| 894 | std::string SDLDriver::GetHatButtonName(u8 direction_value) const { | 893 | std::string SDLDriver::GetHatButtonName(u8 direction_value) const { |