# SDL: Document that it's not possible to use the HIDAPI driver for PS3 controllers on Windows

**URL:** <https://discourse.libsdl.org/t/sdl-document-that-its-not-possible-to-use-the-hidapi-driver-for-ps3-controllers-on-windows/38356>\
**Category:** SDL Commits\
**Created:** [August 24, 2022, 1:40pm UTC](https://discourse.libsdl.org/t/sdl-document-that-its-not-possible-to-use-the-hidapi-driver-for-ps3-controllers-on-windows/38356 "2022-08-24T13:40:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SDLPushPostBot](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/sdlpushpostbot/32/4370_2.png) [@SDLPushPostBot](https://discourse.libsdl.org/u/SDLPushPostBot)\
**Post date:** [August 24, 2022, 1:40pm UTC](https://discourse.libsdl.org/t/sdl-document-that-its-not-possible-to-use-the-hidapi-driver-for-ps3-controllers-on-windows/38356/1 "2022-08-24T13:40:02Z")

</div>

> <https://github.com/libsdl-org/SDL/commit/1fc7f681187f80ccd6b9625214b47db665cd9aaf>

```diff
From 1fc7f681187f80ccd6b9625214b47db665cd9aaf Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Wed, 24 Aug 2022 06:38:36 -0700
Subject: [PATCH] Document that it's not possible to use the HIDAPI driver for
 PS3 controllers on Windows

---
 include/SDL_hints.h | 5 ++++-
 src/joystick/hidapi/SDL_hidapi_ps3.c | 20 ++++++++++++++++----
 2 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/include/SDL_hints.h b/include/SDL_hints.h
index 6f2823572d5..48f4f3689a7 100644
--- a/include/SDL_hints.h
+++ b/include/SDL_hints.h
@@ -712,7 +712,10 @@ extern "C" {
  * "0" - HIDAPI driver is not used
  * "1" - HIDAPI driver is used
  *
- * The default is the value of SDL_HINT_JOYSTICK_HIDAPI
+ * The default is the value of SDL_HINT_JOYSTICK_HIDAPI on macOS, and "0" on other platforms.
+ *
+ * It is not possible to use this driver on Windows, due to limitations in the default drivers
+ * installed. See https://github.com/ViGEm/DsHidMini for an alternative driver on Windows.
  */
 #define SDL_HINT_JOYSTICK_HIDAPI_PS3 "SDL_JOYSTICK_HIDAPI_PS3"
 
diff --git a/src/joystick/hidapi/SDL_hidapi_ps3.c b/src/joystick/hidapi/SDL_hidapi_ps3.c
index ba20e28edd8..c178a9f5a57 100644
--- a/src/joystick/hidapi/SDL_hidapi_ps3.c
+++ b/src/joystick/hidapi/SDL_hidapi_ps3.c
@@ -79,15 +79,27 @@ HIDAPI_DriverPS3_UnregisterHints(SDL_HintCallback callback, void *userdata)
 static SDL_bool
 HIDAPI_DriverPS3_IsEnabled(void)
 {
-#ifdef __MACOSX__
+#if defined( __MACOSX__ )
+ /* This works well on macOS */
     return SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_PS3,
                SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI,
                    SDL_HIDAPI_DEFAULT));
-#else
- /* Linux already has good PS3 drivers and controller initialization fails on Windows,
- * so don't bother using this driver on other platforms.
+#elif defined( __WINDOWS__ )
+ /* You can't initialize the controller with the stock Windows drivers
+ * See https://github.com/ViGEm/DsHidMini as an alternative driver
+ */
+ return SDL_FALSE;
+#elif defined( __LINUX__ )
+ /* Linux drivers do a better job of managing the transition between
+ * USB and Bluetooth. There are also some quirks in communicating
+ * with PS3 controllers that have been implemented in SDL's hidapi
+ * for libusb, but are not possible to support using hidraw if the
+ * kernel doesn't already know about them.
      */
     return SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_PS3, SDL_FALSE);
+#else
+ /* Untested, default off */
+ return SDL_GetHintBoolean(SDL_HINT_JOYSTICK_HIDAPI_PS3, SDL_FALSE);
 #endif
 }
 

```
