diff options
| author | bunnei <bunneidev@gmail.com> | 2021-10-02 02:58:25 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-02 02:58:25 -0700 |
| commit | ceafd4f92cb2b1bf21580dcae97bdf12ef443193 (patch) | |
| tree | ee324cfed544ce51d182f702d87f600777a72484 /src/input_common | |
| parent | 8b1115a07f14ea0172cf3233d27d4e6c8a1e5ec8 (diff) | |
| parent | 94028da35e936cb158fd0055b7ad9ac445a22f04 (diff) | |
Merge pull request #6979 from german77/joycon_name
input_common: Add alternative string for joycons
Diffstat (limited to 'src/input_common')
| -rw-r--r-- | src/input_common/sdl/sdl_impl.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/input_common/sdl/sdl_impl.cpp b/src/input_common/sdl/sdl_impl.cpp index 03888b7cb7..ab6211b29c 100644 --- a/src/input_common/sdl/sdl_impl.cpp +++ b/src/input_common/sdl/sdl_impl.cpp @@ -254,11 +254,25 @@ public: } bool IsJoyconLeft() const { - return std::strstr(GetControllerName().c_str(), "Joy-Con Left") != nullptr; + const std::string controller_name = GetControllerName(); + if (std::strstr(controller_name.c_str(), "Joy-Con Left") != nullptr) { + return true; + } + if (std::strstr(controller_name.c_str(), "Joy-Con (L)") != nullptr) { + return true; + } + return false; } bool IsJoyconRight() const { - return std::strstr(GetControllerName().c_str(), "Joy-Con Right") != nullptr; + const std::string controller_name = GetControllerName(); + if (std::strstr(controller_name.c_str(), "Joy-Con Right") != nullptr) { + return true; + } + if (std::strstr(controller_name.c_str(), "Joy-Con (R)") != nullptr) { + return true; + } + return false; } std::string GetControllerName() const { |
