summaryrefslogtreecommitdiffstats
path: root/src/input_common/sdl/sdl_impl.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-10-02 11:58:25 +0200
committerGitHub <noreply@github.com>2021-10-02 11:58:25 +0200
commit21ed944ff9aa274657f9a6d097b516fbe6241b6b (patch)
treeee324cfed544ce51d182f702d87f600777a72484 /src/input_common/sdl/sdl_impl.cpp
parentMerge pull request #7093 from Morph1984/exit (diff)
parentinput_common: Add alternative string for joycons (diff)
downloadyuzu-21ed944ff9aa274657f9a6d097b516fbe6241b6b.tar
yuzu-21ed944ff9aa274657f9a6d097b516fbe6241b6b.tar.gz
yuzu-21ed944ff9aa274657f9a6d097b516fbe6241b6b.tar.bz2
yuzu-21ed944ff9aa274657f9a6d097b516fbe6241b6b.tar.lz
yuzu-21ed944ff9aa274657f9a6d097b516fbe6241b6b.tar.xz
yuzu-21ed944ff9aa274657f9a6d097b516fbe6241b6b.tar.zst
yuzu-21ed944ff9aa274657f9a6d097b516fbe6241b6b.zip
Diffstat (limited to 'src/input_common/sdl/sdl_impl.cpp')
-rw-r--r--src/input_common/sdl/sdl_impl.cpp18
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:
}
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 {