2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

Merge pull request #6979 from german77/joycon_name

input_common: Add alternative string for joycons
This commit is contained in:
bunnei 2021-10-02 02:58:25 -07:00 committed by GitHub
commit 21ed944ff9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 {