diff options
Diffstat (limited to 'src/input_common/main.cpp')
| -rw-r--r-- | src/input_common/main.cpp | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/input_common/main.cpp b/src/input_common/main.cpp index df36a337c..39e4935dc 100644 --- a/src/input_common/main.cpp +++ b/src/input_common/main.cpp | |||
| @@ -205,9 +205,9 @@ struct InputSubsystem::Impl { | |||
| 205 | return {}; | 205 | return {}; |
| 206 | } | 206 | } |
| 207 | 207 | ||
| 208 | std::string GetButtonName(const Common::ParamPackage& params) const { | 208 | Common::Input::ButtonNames GetButtonName(const Common::ParamPackage& params) const { |
| 209 | if (!params.Has("engine") || params.Get("engine", "") == "any") { | 209 | if (!params.Has("engine") || params.Get("engine", "") == "any") { |
| 210 | return "Unknown"; | 210 | return Common::Input::ButtonNames::Undefined; |
| 211 | } | 211 | } |
| 212 | const std::string engine = params.Get("engine", ""); | 212 | const std::string engine = params.Get("engine", ""); |
| 213 | if (engine == mouse->GetEngineName()) { | 213 | if (engine == mouse->GetEngineName()) { |
| @@ -227,7 +227,7 @@ struct InputSubsystem::Impl { | |||
| 227 | return sdl->GetUIName(params); | 227 | return sdl->GetUIName(params); |
| 228 | } | 228 | } |
| 229 | #endif | 229 | #endif |
| 230 | return "Bad engine"; | 230 | return Common::Input::ButtonNames::Invalid; |
| 231 | } | 231 | } |
| 232 | 232 | ||
| 233 | bool IsController(const Common::ParamPackage& params) { | 233 | bool IsController(const Common::ParamPackage& params) { |
| @@ -361,15 +361,8 @@ MotionMapping InputSubsystem::GetMotionMappingForDevice(const Common::ParamPacka | |||
| 361 | return impl->GetMotionMappingForDevice(device); | 361 | return impl->GetMotionMappingForDevice(device); |
| 362 | } | 362 | } |
| 363 | 363 | ||
| 364 | std::string InputSubsystem::GetButtonName(const Common::ParamPackage& params) const { | 364 | Common::Input::ButtonNames InputSubsystem::GetButtonName(const Common::ParamPackage& params) const { |
| 365 | const std::string toggle = params.Get("toggle", false) ? "~" : ""; | 365 | return impl->GetButtonName(params); |
| 366 | const std::string inverted = params.Get("inverted", false) ? "!" : ""; | ||
| 367 | const std::string button_name = impl->GetButtonName(params); | ||
| 368 | std::string axis_direction = ""; | ||
| 369 | if (params.Has("axis")) { | ||
| 370 | axis_direction = params.Get("invert", "+"); | ||
| 371 | } | ||
| 372 | return fmt::format("{}{}{}{}", toggle, inverted, button_name, axis_direction); | ||
| 373 | } | 366 | } |
| 374 | 367 | ||
| 375 | bool InputSubsystem::IsController(const Common::ParamPackage& params) const { | 368 | bool InputSubsystem::IsController(const Common::ParamPackage& params) const { |