diff options
Diffstat (limited to 'src/input_common/sdl')
| -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 03888b7cb..ab6211b29 100644 --- a/src/input_common/sdl/sdl_impl.cpp +++ b/src/input_common/sdl/sdl_impl.cpp | |||
| @@ -254,11 +254,25 @@ public: | |||
| 254 | } | 254 | } |
| 255 | 255 | ||
| 256 | bool IsJoyconLeft() const { | 256 | bool IsJoyconLeft() const { |
| 257 | return std::strstr(GetControllerName().c_str(), "Joy-Con Left") != nullptr; | 257 | const std::string controller_name = GetControllerName(); |
| 258 | if (std::strstr(controller_name.c_str(), "Joy-Con Left") != nullptr) { | ||
| 259 | return true; | ||
| 260 | } | ||
| 261 | if (std::strstr(controller_name.c_str(), "Joy-Con (L)") != nullptr) { | ||
| 262 | return true; | ||
| 263 | } | ||
| 264 | return false; | ||
| 258 | } | 265 | } |
| 259 | 266 | ||
| 260 | bool IsJoyconRight() const { | 267 | bool IsJoyconRight() const { |
| 261 | return std::strstr(GetControllerName().c_str(), "Joy-Con Right") != nullptr; | 268 | const std::string controller_name = GetControllerName(); |
| 269 | if (std::strstr(controller_name.c_str(), "Joy-Con Right") != nullptr) { | ||
| 270 | return true; | ||
| 271 | } | ||
| 272 | if (std::strstr(controller_name.c_str(), "Joy-Con (R)") != nullptr) { | ||
| 273 | return true; | ||
| 274 | } | ||
| 275 | return false; | ||
| 262 | } | 276 | } |
| 263 | 277 | ||
| 264 | std::string GetControllerName() const { | 278 | std::string GetControllerName() const { |