Browse Source
Merge pull request #6979 from german77/joycon_name
input_common: Add alternative string for joycons
pull/15/merge
bunnei
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
16 additions and
2 deletions
-
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 { |
|
|
|
|