فهرست منبع

input_common: Add alternative string for joycons

german77 4 سال پیش
والد
کامیت
4bc3c788f5
1فایلهای تغییر یافته به همراه16 افزوده شده و 2 حذف شده
  1. 16 2
      src/input_common/sdl/sdl_impl.cpp

+ 16 - 2
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 {