SDL: Removed the WGI and RAWINPUT joystick drivers

From 81b4769b0e6f6e77b44003790bda4389b3b75d9d Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Wed, 28 Oct 2026 14:18:32 -0700
Subject: [PATCH] Removed the WGI and RAWINPUT joystick drivers

These are functionally replaced by GameInput and are not enabled by default due to various limitations.
---
 CMakeLists.txt                                |   12 -
 VisualC-GDK/SDL/SDL.vcxproj                   |    3 -
 VisualC-GDK/SDL/SDL.vcxproj.filters           |    3 -
 VisualC/SDL/SDL.vcxproj                       |    3 -
 VisualC/SDL/SDL.vcxproj.filters               |    9 -
 cmake/PreseedMSVCCache.cmake                  |    2 -
 include/SDL3/SDL_hints.h                      |   52 +-
 include/build_config/SDL_build_config.h.cmake |    3 -
 .../build_config/SDL_build_config_windows.h   |    5 -
 .../build_config/SDL_build_config_wingdk.h    |    3 -
 include/build_config/SDL_build_config_xbox.h  |    1 -
 src/joystick/SDL_gamepad.c                    |   36 -
 src/joystick/SDL_gamepad_db.h                 |    9 -
 src/joystick/SDL_joystick.c                   |   26 +-
 src/joystick/SDL_joystick_c.h                 |    6 -
 src/joystick/SDL_sysjoystick.h                |    2 -
 src/joystick/hidapi/SDL_hidapijoystick.c      |    1 -
 src/joystick/windows/SDL_dinputjoystick.c     |   13 +-
 src/joystick/windows/SDL_rawinputjoystick.c   | 2240 -----------------
 src/joystick/windows/SDL_rawinputjoystick_c.h |   32 -
 .../windows/SDL_windows_gaming_input.c        | 1043 --------
 src/joystick/windows/SDL_windowsjoystick.c    |   24 -
 src/joystick/windows/SDL_xinputjoystick.c     |   15 -
 23 files changed, 9 insertions(+), 3534 deletions(-)
 delete mode 100644 src/joystick/windows/SDL_rawinputjoystick.c
 delete mode 100644 src/joystick/windows/SDL_rawinputjoystick_c.h
 delete mode 100644 src/joystick/windows/SDL_windows_gaming_input.c

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2bedb9808eddb..032e35dd65d5c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2519,14 +2519,6 @@ elseif(WINDOWS OR CYGWIN)
     )
   endif()
 
-  # headers needed elsewhere
-  check_c_source_compiles("
-    #define COBJMACROS
-    #include <windows.gaming.input.h>
-    static __x_ABI_CWindows_CGaming_CInput_CIGamepadStatics2 *s2;
-    int main(int argc, char **argv) { return 0; }" HAVE_WINDOWS_GAMING_INPUT_H
-  )
-
   set(HAVE_GAMEINPUT_H 1)
   sdl_include_directories(PRIVATE SYSTEM "${SDL3_SOURCE_DIR}/src/core/windows/gameinput")
   sdl_sources("${SDL3_SOURCE_DIR}/src/core/windows/gameinput/gameinput.cpp")
@@ -2722,7 +2714,6 @@ elseif(WINDOWS OR CYGWIN)
       "${SDL3_SOURCE_DIR}/src/joystick/windows/*.h"
     )
 
-    set(SDL_JOYSTICK_RAWINPUT 1)
     if(HAVE_DINPUT_H)
       set(SDL_JOYSTICK_DINPUT 1)
       sdl_link_dependency(joystick LIBS dinput8)
@@ -2731,9 +2722,6 @@ elseif(WINDOWS OR CYGWIN)
       set(SDL_JOYSTICK_XINPUT 1)
       set(HAVE_XINPUT TRUE)
     endif()
-    if(HAVE_WINDOWS_GAMING_INPUT_H)
-      set(SDL_JOYSTICK_WGI 1)
-    endif()
     if(HAVE_GAMEINPUT_H)
       sdl_glob_sources("${SDL3_SOURCE_DIR}/src/joystick/gdk/*.cpp")
       set(SDL_JOYSTICK_GAMEINPUT 1)
diff --git a/VisualC-GDK/SDL/SDL.vcxproj b/VisualC-GDK/SDL/SDL.vcxproj
index 92a2db6536a7d..b15183702ce5c 100644
--- a/VisualC-GDK/SDL/SDL.vcxproj
+++ b/VisualC-GDK/SDL/SDL.vcxproj
@@ -477,7 +477,6 @@
     <ClInclude Include="..\..\src\joystick\usb_ids.h" />
     <ClInclude Include="..\..\src\joystick\virtual\SDL_virtualjoystick_c.h" />
     <ClInclude Include="..\..\src\joystick\windows\SDL_dinputjoystick_c.h" />
-    <ClInclude Include="..\..\src\joystick\windows\SDL_rawinputjoystick_c.h" />
     <ClInclude Include="..\..\src\joystick\windows\SDL_windowsjoystick_c.h" />
     <ClInclude Include="..\..\src\joystick\windows\SDL_xinputjoystick_c.h" />
     <ClInclude Include="..\..\src\libm\math_libm.h" />
@@ -756,7 +755,6 @@
     <ClCompile Include="..\..\src\joystick\SDL_steam_virtual_gamepad.c" />
     <ClCompile Include="..\..\src\joystick\virtual\SDL_virtualjoystick.c" />
     <ClCompile Include="..\..\src\joystick\windows\SDL_dinputjoystick.c" />
-    <ClCompile Include="..\..\src\joystick\windows\SDL_rawinputjoystick.c" />
     <ClCompile Include="..\..\src\joystick\windows\SDL_windowsjoystick.c">
       <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">CompileAsCpp</CompileAs>
       <CompileAs Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">CompileAsCpp</CompileAs>
@@ -767,7 +765,6 @@
       <LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.Scarlett.x64'">stdcpp17</LanguageStandard>
       <LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Xbox.XboxOne.x64'">stdcpp17</LanguageStandard>
     </ClCompile>
-    <ClCompile Include="..\..\src\joystick\windows\SDL_windows_gaming_input.c" />
     <ClCompile Include="..\..\src\joystick\windows\SDL_xinputjoystick.c">
       <LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.Scarlett.x64'">stdcpp17</LanguageStandard>
       <LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Xbox.XboxOne.x64'">stdcpp17</LanguageStandard>
diff --git a/VisualC-GDK/SDL/SDL.vcxproj.filters b/VisualC-GDK/SDL/SDL.vcxproj.filters
index 14ed1f78585af..e4fa308ce7591 100644
--- a/VisualC-GDK/SDL/SDL.vcxproj.filters
+++ b/VisualC-GDK/SDL/SDL.vcxproj.filters
@@ -103,9 +103,7 @@
     <ClCompile Include="..\..\src\joystick\SDL_steam_virtual_gamepad.c" />
     <ClCompile Include="..\..\src\joystick\virtual\SDL_virtualjoystick.c" />
     <ClCompile Include="..\..\src\joystick\windows\SDL_dinputjoystick.c" />
-    <ClCompile Include="..\..\src\joystick\windows\SDL_rawinputjoystick.c" />
     <ClCompile Include="..\..\src\joystick\windows\SDL_windowsjoystick.c" />
-    <ClCompile Include="..\..\src\joystick\windows\SDL_windows_gaming_input.c" />
     <ClCompile Include="..\..\src\joystick\windows\SDL_xinputjoystick.c" />
     <ClCompile Include="..\..\src\libm\s_modf.c" />
     <ClCompile Include="..\..\src\loadso\windows\SDL_sysloadso.c" />
@@ -392,7 +390,6 @@
     <ClInclude Include="..\..\src\joystick\usb_ids.h" />
     <ClInclude Include="..\..\src\joystick\virtual\SDL_virtualjoystick_c.h" />
     <ClInclude Include="..\..\src\joystick\windows\SDL_dinputjoystick_c.h" />
-    <ClInclude Include="..\..\src\joystick\windows\SDL_rawinputjoystick_c.h" />
     <ClInclude Include="..\..\src\joystick\windows\SDL_windowsjoystick_c.h" />
     <ClInclude Include="..\..\src\joystick\windows\SDL_xinputjoystick_c.h" />
     <ClInclude Include="..\..\src\libm\math_libm.h" />
diff --git a/VisualC/SDL/SDL.vcxproj b/VisualC/SDL/SDL.vcxproj
index a408b6dd63412..15a63c6c9a7c9 100644
--- a/VisualC/SDL/SDL.vcxproj
+++ b/VisualC/SDL/SDL.vcxproj
@@ -515,7 +515,6 @@
     <ClInclude Include="..\..\src\joystick\usb_ids.h" />
     <ClInclude Include="..\..\src\joystick\virtual\SDL_virtualjoystick_c.h" />
     <ClInclude Include="..\..\src\joystick\windows\SDL_dinputjoystick_c.h" />
-    <ClInclude Include="..\..\src\joystick\windows\SDL_rawinputjoystick_c.h" />
     <ClInclude Include="..\..\src\joystick\windows\SDL_windowsjoystick_c.h" />
     <ClInclude Include="..\..\src\joystick\windows\SDL_xinputjoystick_c.h" />
     <ClInclude Include="..\..\src\libm\math_libm.h" />
@@ -860,9 +859,7 @@
     <ClCompile Include="..\..\src\joystick\SDL_steam_virtual_gamepad.c" />
     <ClCompile Include="..\..\src\joystick\virtual\SDL_virtualjoystick.c" />
     <ClCompile Include="..\..\src\joystick\windows\SDL_dinputjoystick.c" />
-    <ClCompile Include="..\..\src\joystick\windows\SDL_rawinputjoystick.c" />
     <ClCompile Include="..\..\src\joystick\windows\SDL_windowsjoystick.c" />
-    <ClCompile Include="..\..\src\joystick\windows\SDL_windows_gaming_input.c" />
     <ClCompile Include="..\..\src\joystick\windows\SDL_xinputjoystick.c" />
     <ClCompile Include="..\..\src\libm\s_modf.c" />
     <ClCompile Include="..\..\src\loadso\windows\SDL_sysloadso.c" />
diff --git a/VisualC/SDL/SDL.vcxproj.filters b/VisualC/SDL/SDL.vcxproj.filters
index c9b3d5cd197ea..bc125d39a1c11 100644
--- a/VisualC/SDL/SDL.vcxproj.filters
+++ b/VisualC/SDL/SDL.vcxproj.filters
@@ -690,9 +690,6 @@
     <ClInclude Include="..\..\src\joystick\windows\SDL_dinputjoystick_c.h">
       <Filter>joystick\windows</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\src\joystick\windows\SDL_rawinputjoystick_c.h">
-      <Filter>joystick\windows</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\src\joystick\windows\SDL_windowsjoystick_c.h">
       <Filter>joystick\windows</Filter>
     </ClInclude>
@@ -1675,12 +1672,6 @@
     <ClCompile Include="..\..\src\joystick\windows\SDL_dinputjoystick.c">
       <Filter>joystick\windows</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\src\joystick\windows\SDL_rawinputjoystick.c">
-      <Filter>joystick\windows</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\src\joystick\windows\SDL_windows_gaming_input.c">
-      <Filter>joystick\windows</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\src\joystick\windows\SDL_windowsjoystick.c">
       <Filter>joystick\windows</Filter>
     </ClCompile>
diff --git a/cmake/PreseedMSVCCache.cmake b/cmake/PreseedMSVCCache.cmake
index 7456d50c0f7ba..ea9f6370672e3 100644
--- a/cmake/PreseedMSVCCache.cmake
+++ b/cmake/PreseedMSVCCache.cmake
@@ -186,10 +186,8 @@ if(MSVC)
 
       if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "19.1")
         set(HAVE_ROAPI_H                                     "1"   CACHE INTERNAL "Have include roapi.h")
-        set(HAVE_WINDOWS_GAMING_INPUT_H                      "1"   CACHE INTERNAL "Test HAVE_WINDOWS_GAMING_INPUT_H")
       else()
         set(HAVE_ROAPI_H                                     ""    CACHE INTERNAL "Have include roapi.h")
-        set(HAVE_WINDOWS_GAMING_INPUT_H                      ""    CACHE INTERNAL "Test HAVE_WINDOWS_GAMING_INPUT_H")
       endif()
     endif()
   endfunction()
diff --git a/include/SDL3/SDL_hints.h b/include/SDL3/SDL_hints.h
index 68b67cc071a75..bf543319586d6 100644
--- a/include/SDL3/SDL_hints.h
+++ b/include/SDL3/SDL_hints.h
@@ -2421,38 +2421,6 @@ extern "C" {
  */
 #define SDL_HINT_JOYSTICK_MFI "SDL_JOYSTICK_MFI"
 
-/**
- * A variable controlling whether the RAWINPUT joystick drivers should be used
- * for better handling XInput-capable devices.
- *
- * The variable can be set to the following values:
- *
- * - "0": RAWINPUT drivers are not used. (default)
- * - "1": RAWINPUT drivers are used.
- *
- * This hint should be set before SDL is initialized.
- *
- * \since This hint is available since SDL 3.2.0.
- */
-#define SDL_HINT_JOYSTICK_RAWINPUT "SDL_JOYSTICK_RAWINPUT"
-
-/**
- * A variable controlling whether the RAWINPUT driver should pull correlated
- * data from XInput.
- *
- * The variable can be set to the following values:
- *
- * - "0": RAWINPUT driver will only use data from raw input APIs.
- * - "1": RAWINPUT driver will also pull data from XInput and
- *   Windows.Gaming.Input, providing better trigger axes, guide button
- *   presses, and rumble support for Xbox controllers. (default)
- *
- * This hint should be set before a gamepad is opened.
- *
- * \since This hint is available since SDL 3.2.0.
- */
-#define SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT "SDL_JOYSTICK_RAWINPUT_CORRELATE_XINPUT"
-
 /**
  * A variable controlling whether the ROG Chakram mice should show up as
  * joysticks.
@@ -2470,12 +2438,13 @@ extern "C" {
 
 /**
  * A variable controlling whether a separate thread should be used for
- * handling joystick detection and raw input messages on Windows.
+ * handling joystick detection on Windows.
  *
  * The variable can be set to the following values:
  *
  * - "0": A separate thread is not used.
- * - "1": A separate thread is used for handling raw input messages. (default)
+ * - "1": A separate thread is used for handling device change messages.
+ *   (default)
  *
  * This hint should be set before SDL is initialized.
  *
@@ -2521,21 +2490,6 @@ extern "C" {
  */
 #define SDL_HINT_JOYSTICK_THROTTLE_DEVICES_EXCLUDED "SDL_JOYSTICK_THROTTLE_DEVICES_EXCLUDED"
 
-/**
- * A variable controlling whether Windows.Gaming.Input should be used for
- * controller handling.
- *
- * The variable can be set to the following values:
- *
- * - "0": WGI is not used. (default)
- * - "1": WGI is used.
- *
- * This hint should be set before SDL is initialized.
- *
- * \since This hint is available since SDL 3.2.0.
- */
-#define SDL_HINT_JOYSTICK_WGI "SDL_JOYSTICK_WGI"
-
 /**
  * A variable containing a list of wheel style controllers.
  *
diff --git a/include/build_config/SDL_build_config.h.cmake b/include/build_config/SDL_build_config.h.cmake
index b461a8660b8f2..ac8050dbdde43 100644
--- a/include/build_config/SDL_build_config.h.cmake
+++ b/include/build_config/SDL_build_config.h.cmake
@@ -233,7 +233,6 @@
 #cmakedefine HAVE_DSOUND_H 1
 #cmakedefine HAVE_DINPUT_H 1
 #cmakedefine HAVE_XINPUT_H 1
-#cmakedefine HAVE_WINDOWS_GAMING_INPUT_H 1
 #cmakedefine HAVE_GAMEINPUT_H 1
 #cmakedefine SDL_GAMEINPUT_DYNAMIC 1
 #cmakedefine HAVE_DXGI_H 1
@@ -323,11 +322,9 @@
 #cmakedefine SDL_JOYSTICK_N3DS 1
 #cmakedefine SDL_JOYSTICK_PS2 1
 #cmakedefine SDL_JOYSTICK_PSP 1
-#cmakedefine SDL_JOYSTICK_RAWINPUT 1
 #cmakedefine SDL_JOYSTICK_USBHID 1
 #cmakedefine SDL_JOYSTICK_VIRTUAL 1
 #cmakedefine SDL_JOYSTICK_VITA 1
-#cmakedefine SDL_JOYSTICK_WGI 1
 #cmakedefine SDL_JOYSTICK_XINPUT 1
 
 #cmakedefine SDL_JOYSTICK_PRIVATE 1
diff --git a/include/build_config/SDL_build_config_windows.h b/include/build_config/SDL_build_config_windows.h
index 36050400e831c..08809f4c8477c 100644
--- a/include/build_config/SDL_build_config_windows.h
+++ b/include/build_config/SDL_build_config_windows.h
@@ -87,7 +87,6 @@ typedef unsigned int uintptr_t;
 #if defined(_WIN32_MAXVER) && _WIN32_MAXVER >= 0x0A00  /* Windows 10 SDK */
 #define HAVE_DXGI1_5_H 1
 #define HAVE_DXGI1_6_H 1
-#define HAVE_WINDOWS_GAMING_INPUT_H 1
 #endif
 #if defined(_WIN32_MAXVER) && _WIN32_MAXVER >= 0x0602  /* Windows 8 SDK */
 #define HAVE_D3D11_H 1
@@ -225,11 +224,7 @@ typedef unsigned int uintptr_t;
 #define SDL_JOYSTICK_DINPUT 1
 #define SDL_JOYSTICK_GAMEINPUT 1
 #define SDL_JOYSTICK_HIDAPI 1
-#define SDL_JOYSTICK_RAWINPUT 1
 #define SDL_JOYSTICK_VIRTUAL 1
-#ifdef HAVE_WINDOWS_GAMING_INPUT_H
-#define SDL_JOYSTICK_WGI 1
-#endif
 #define SDL_JOYSTICK_XINPUT 1
 #define SDL_HAPTIC_DINPUT 1
 
diff --git a/include/build_config/SDL_build_config_wingdk.h b/include/build_config/SDL_build_config_wingdk.h
index ee06c1c649245..188883ae88056 100644
--- a/include/build_config/SDL_build_config_wingdk.h
+++ b/include/build_config/SDL_build_config_wingdk.h
@@ -40,7 +40,6 @@
 #define HAVE_DXGI1_5_H 1
 #define HAVE_DXGI1_6_H 1
 #define HAVE_XINPUT_H 1
-#define HAVE_WINDOWS_GAMING_INPUT_H 1
 #define HAVE_D3D11_H 1
 #define HAVE_ROAPI_H 1
 #define HAVE_SHELLSCALINGAPI_H 1
@@ -160,9 +159,7 @@
 #define SDL_JOYSTICK_DINPUT 1
 #define SDL_JOYSTICK_GAMEINPUT 1
 #define SDL_JOYSTICK_HIDAPI 1
-#define SDL_JOYSTICK_RAWINPUT 1
 #define SDL_JOYSTICK_VIRTUAL 1
-#define SDL_JOYSTICK_WGI 1
 #define SDL_JOYSTICK_XINPUT 1
 #define SDL_HAPTIC_DINPUT 1
 
diff --git a/include/build_config/SDL_build_config_xbox.h b/include/build_config/SDL_build_config_xbox.h
index 0841a1cc0150a..7c6aa9bd0b27c 100644
--- a/include/build_config/SDL_build_config_xbox.h
+++ b/include/build_config/SDL_build_config_xbox.h
@@ -38,7 +38,6 @@
 /* No SDK version checks needed for these because the SDK has to be new. */
 /* #define HAVE_DXGI_H 1 */
 #define HAVE_XINPUT_H 1
-/*#define HAVE_WINDOWS_GAMING_INPUT_H 1*/
 /*#define HAVE_ROAPI_H 1*/
 /*#define HAVE_SHELLSCALINGAPI_H 1*/
 #define HAVE_MMDEVICEAPI_H 1
diff --git a/src/joystick/SDL_gamepad.c b/src/joystick/SDL_gamepad.c
index 71dfc07df0e9a..a2de0959169b4 100644
--- a/src/joystick/SDL_gamepad.c
+++ b/src/joystick/SDL_gamepad.c
@@ -1351,38 +1351,6 @@ static GamepadMapping_t *SDL_CreateMappingForHIDAPIGamepad(SDL_GUID guid)
     return SDL_PrivateAddMappingForGUID(guid, mapping_string, &existing, SDL_GAMEPAD_MAPPING_PRIORITY_DEFAULT);
 }
 
-/*
- * Helper function to guess at a mapping for RAWINPUT gamepads
- */
-static GamepadMapping_t *SDL_CreateMappingForRAWINPUTGamepad(SDL_GUID guid)
-{
-    bool existing;
-    char mapping_string[1024];
-
-    SDL_strlcpy(mapping_string, "none,*,", sizeof(mapping_string));
-    SDL_strlcat(mapping_string, "a:b0,b:b1,x:b2,y:b3,back:b6,guide:b10,start:b7,leftstick:b8,rightstick:b9,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,", sizeof(mapping_string));
-
-    return SDL_PrivateAddMappingForGUID(guid, mapping_string, &existing, SDL_GAMEPAD_MAPPING_PRIORITY_DEFAULT);
-}
-
-/*
- * Helper function to guess at a mapping for WGI gamepads
- */
-static GamepadMapping_t *SDL_CreateMappingForWGIGamepad(SDL_GUID guid)
-{
-    bool existing;
-    char mapping_string[1024];
-
-    if (guid.data[15] != SDL_JOYSTICK_TYPE_GAMEPAD) {
-        return NULL;
-    }
-
-    SDL_strlcpy(mapping_string, "none,*,", sizeof(mapping_string));
-    SDL_strlcat(mapping_string, "a:b0,b:b1,x:b2,y:b3,back:b6,start:b7,leftstick:b8,rightstick:b9,leftshoulder:b4,rightshoulder:b5,dpup:b10,dpdown:b12,dpleft:b13,dpright:b11,leftx:a1,lefty:a0~,rightx:a3,righty:a2~,lefttrigger:a4,righttrigger:a5,", sizeof(mapping_string));
-
-    return SDL_PrivateAddMappingForGUID(guid, mapping_string, &existing, SDL_GAMEPAD_MAPPING_PRIORITY_DEFAULT);
-}
-
 /*
  * Helper function to scan the mappings database for a gamepad with the specified GUID
  */
@@ -1482,10 +1450,6 @@ static GamepadMapping_t *SDL_PrivateGetGamepadMappingForGUID(SDL_GUID guid, bool
 #endif
     if (SDL_IsJoystickHIDAPI(guid)) {
         mapping = SDL_CreateMappingForHIDAPIGamepad(guid);
-    } else if (SDL_IsJoystickRAWINPUT(guid)) {
-        mapping = SDL_CreateMappingForRAWINPUTGamepad(guid);
-    } else if (SDL_IsJoystickWGI(guid)) {
-        mapping = SDL_CreateMappingForWGIGamepad(guid);
     } else if (SDL_IsJoystickVIRTUAL(guid)) {
         // We'll pick up a robust mapping in VIRTUAL_JoystickGetGamepadMapping
 #ifdef SDL_PLATFORM_ANDROID
diff --git a/src/joystick/SDL_gamepad_db.h b/src/joystick/SDL_gamepad_db.h
index fc49ed847e148..d54a65755d452 100644
--- a/src/joystick/SDL_gamepad_db.h
+++ b/src/joystick/SDL_gamepad_db.h
@@ -35,15 +35,6 @@ static const char *s_GamepadMappings[] = {
 #ifdef SDL_JOYSTICK_XINPUT
     "xinput,*,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,",
 #endif
-#ifdef SDL_JOYSTICK_WGI
-    "03000000491900001904000000007700,Amazon Luna Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,misc1:b9,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b7,x:b2,y:b3,",
-    "03000000d11800000094000000007700,Google Stadia Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b12,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,",
-    "030000007e0500000920000000007701,Nintendo Switch Pro Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,",
-    "030000004c050000c405000000007701,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,",
-    "030000004c050000e60c000000007700,PS5 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,misc1:b14,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,",
-    "0300000032150000000a000000007703,Razer Atrox Arcade Stick,a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b11,dpup:b10,leftshoulder:b4,lefttrigger:b8,rightshoulder:b5,righttrigger:b9,x:b2,y:b3,",
-    "03000000de280000ff11000000007701,Steam Virtual Gamepad,a:b0,b:b1,back:b6,dpdown:b12,dpleft:b13,dpright:b11,dpup:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a4,leftx:a1,lefty:a0~,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a2~,start:b7,x:b2,y:b3,",
-#endif
 #ifdef SDL_JOYSTICK_DINPUT
     "03000000fa2d00000100000000000000,3DRUDDER,leftx:a0,lefty:a1,rightx:a5,righty:a2,",
     "03000000c82d00001930000000000000,8BitDo 64 Bluetooth Controller,a:b0,b:b1,back:-a5,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a2,misc1:b17,misc2:+a3,rightshoulder:b7,righttrigger:b9,start:b11,x:+a5,y:-a3,",
diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c
index 4eacef4f32fca..cfa23496470dc 100644
--- a/src/joystick/SDL_joystick.c
+++ b/src/joystick/SDL_joystick.c
@@ -58,15 +58,9 @@ static SDL_JoystickDriver *SDL_joystick_drivers[] = {
 #ifdef SDL_JOYSTICK_GAMEINPUT // Higher priority than other Windows drivers
     &SDL_GAMEINPUT_JoystickDriver,
 #endif
-#ifdef SDL_JOYSTICK_RAWINPUT // Before WINDOWS driver, as WINDOWS wants to check if this driver is handling things
-    &SDL_RAWINPUT_JoystickDriver,
-#endif
-#if defined(SDL_JOYSTICK_DINPUT) || defined(SDL_JOYSTICK_XINPUT) // Before WGI driver, as WGI wants to check if this driver is handling things
+#if defined(SDL_JOYSTICK_DINPUT) || defined(SDL_JOYSTICK_XINPUT)
     &SDL_WINDOWS_JoystickDriver,
 #endif
-#ifdef SDL_JOYSTICK_WGI
-    &SDL_WGI_JoystickDriver,
-#endif
 #ifdef SDL_JOYSTICK_WINMM
     &SDL_WINMM_JoystickDriver,
 #endif
@@ -1449,9 +1443,7 @@ SDL_Joystick *SDL_OpenJoystick(SDL_JoystickID instance_id)
 
     // We know the initial values for HIDAPI and XInput joysticks
     if ((SDL_IsJoystickHIDAPI(joystick->guid) ||
-         SDL_IsJoystickXInput(joystick->guid) ||
-         SDL_IsJoystickRAWINPUT(joystick->guid) ||
-         SDL_IsJoystickWGI(joystick->guid)) &&
+         SDL_IsJoystickXInput(joystick->guid)) &&
         joystick->naxes >= SDL_GAMEPAD_AXIS_COUNT) {
         int left_trigger, right_trigger;
         if (SDL_IsJoystickXInput(joystick->guid)) {
@@ -3586,11 +3578,6 @@ bool SDL_IsJoystickXInput(SDL_GUID guid)
     return (guid.data[14] == 'x') ? true : false;
 }
 
-bool SDL_IsJoystickWGI(SDL_GUID guid)
-{
-    return (guid.data[14] == 'w') ? true : false;
-}
-
 bool SDL_IsJoystickGameInput(SDL_GUID guid)
 {
     return (guid.data[14] == 'g') ? true : false;
@@ -3606,11 +3593,6 @@ bool SDL_IsJoystickMFI(SDL_GUID guid)
     return (guid.data[14] == 'm') ? true : false;
 }
 
-bool SDL_IsJoystickRAWINPUT(SDL_GUID guid)
-{
-    return (guid.data[14] == 'r') ? true : false;
-}
-
 bool SDL_IsJoystickVIRTUAL(SDL_GUID guid)
 {
     return (guid.data[14] == 'v') ? true : false;
@@ -3708,10 +3690,6 @@ static SDL_JoystickType SDL_GetJoystickGUIDType(SDL_GUID guid)
         }
     }
 
-    if (SDL_IsJoystickWGI(guid)) {
-        return (SDL_JoystickType)guid.data[15];
-    }
-
     if (SDL_IsJoystickGameInput(guid)) {
         return (SDL_JoystickType)guid.data[15];
     }
diff --git a/src/joystick/SDL_joystick_c.h b/src/joystick/SDL_joystick_c.h
index c4d940edfaae4..a0bcf8a85d504 100644
--- a/src/joystick/SDL_joystick_c.h
+++ b/src/joystick/SDL_joystick_c.h
@@ -155,9 +155,6 @@ extern bool SDL_IsJoystickSteamTriton(Uint16 vendor_id, Uint16 product_id);
 // Function to return whether a joystick guid comes from the XInput driver
 extern bool SDL_IsJoystickXInput(SDL_GUID guid);
 
-// Function to return whether a joystick guid comes from the WGI driver
-extern bool SDL_IsJoystickWGI(SDL_GUID guid);
-
 // Function to return whether a joystick guid comes from the GameInput driver
 extern bool SDL_IsJoystickGameInput(SDL_GUID guid);
 
@@ -167,9 +164,6 @@ extern bool SDL_IsJoystickHIDAPI(SDL_GUID guid);
 // Function to return whether a joystick guid comes from the MFI driver
 extern bool SDL_IsJoystickMFI(SDL_GUID guid);
 
-// Function to return whether a joystick guid comes from the RAWINPUT driver
-extern bool SDL_IsJoystickRAWINPUT(SDL_GUID guid);
-
 // Function to return whether a joystick guid comes from the Virtual driver
 extern bool SDL_IsJoystickVIRTUAL(SDL_GUID guid);
 
diff --git a/src/joystick/SDL_sysjoystick.h b/src/joystick/SDL_sysjoystick.h
index d428d50bd9574..61dc89ceea016 100644
--- a/src/joystick/SDL_sysjoystick.h
+++ b/src/joystick/SDL_sysjoystick.h
@@ -261,11 +261,9 @@ extern SDL_JoystickDriver SDL_DUMMY_JoystickDriver;
 extern SDL_JoystickDriver SDL_EMSCRIPTEN_JoystickDriver;
 extern SDL_JoystickDriver SDL_HAIKU_JoystickDriver;
 extern SDL_JoystickDriver SDL_HIDAPI_JoystickDriver;
-extern SDL_JoystickDriver SDL_RAWINPUT_JoystickDriver;
 extern SDL_JoystickDriver SDL_IOS_JoystickDriver;
 extern SDL_JoystickDriver SDL_LINUX_JoystickDriver;
 extern SDL_JoystickDriver SDL_VIRTUAL_JoystickDriver;
-extern SDL_JoystickDriver SDL_WGI_JoystickDriver;
 extern SDL_JoystickDriver SDL_WINDOWS_JoystickDriver;
 extern SDL_JoystickDriver SDL_WINMM_JoystickDriver;
 extern SDL_JoystickDriver SDL_PS2_JoystickDriver;
diff --git a/src/joystick/hidapi/SDL_hidapijoystick.c b/src/joystick/hidapi/SDL_hidapijoystick.c
index cd63c56c333fa..277231a0a6e41 100644
--- a/src/joystick/hidapi/SDL_hidapijoystick.c
+++ b/src/joystick/hidapi/SDL_hidapijoystick.c
@@ -28,7 +28,6 @@
 #include "../../SDL_hints_c.h"
 
 #if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK)
-#include "../windows/SDL_rawinputjoystick_c.h"
 #endif
 
 
diff --git a/src/joystick/windows/SDL_dinputjoystick.c b/src/joystick/windows/SDL_dinputjoystick.c
index 1c6134c90977e..ce3e5965c7323 100644
--- a/src/joystick/windows/SDL_dinputjoystick.c
+++ b/src/joystick/windows/SDL_dinputjoystick.c
@@ -26,7 +26,6 @@
 
 #include "SDL_windowsjoystick_c.h"
 #include "SDL_dinputjoystick_c.h"
-#include "SDL_rawinputjoystick_c.h"
 #include "SDL_xinputjoystick_c.h"
 #include "../../core/windows/SDL_gameinput.h"
 #include "../hidapi/SDL_hidapijoystick_c.h"
@@ -235,16 +234,12 @@ static bool SetDIerror(const char *function, HRESULT code)
 
 static bool SDL_IsXInputDevice(Uint16 vendor_id, Uint16 product_id, const char *hidPath)
 {
-#if defined(SDL_JOYSTICK_XINPUT) || defined(SDL_JOYSTICK_RAWINPUT)
+#if defined(SDL_JOYSTICK_XINPUT) || defined(SDL_JOYSTICK_GAMEINPUT)
     SDL_GamepadType type;
 
     // Some other backends will pick up XInput-compatible devices
-    if (!SDL_XINPUT_Enabled()
-#ifdef SDL_JOYSTICK_RAWINPUT
-        && !RAWINPUT_IsEnabled()
-#endif
-        && !SDL_UsingGameInputForXInputControllers()
-    ) {
+    if (!SDL_XINPUT_Enabled() &&
+        !SDL_UsingGameInputForXInputControllers()) {
         return false;
     }
 
@@ -260,7 +255,7 @@ static bool SDL_IsXInputDevice(Uint16 vendor_id, Uint16 product_id, const char *
         (vendor_id == USB_VENDOR_VALVE && product_id == USB_PRODUCT_STEAM_VIRTUAL_GAMEPAD)) {
         return true;
     }
-#endif // SDL_JOYSTICK_XINPUT || SDL_JOYSTICK_RAWINPUT
+#endif // SDL_JOYSTICK_XINPUT || SDL_JOYSTICK_GAMEINPUT
 
     return false;
 }
diff --git a/src/joystick/windows/SDL_rawinputjoystick.c b/src/joystick/windows/SDL_rawinputjoystick.c
deleted file mode 100644
index 4066a7f8d9a37..0000000000000
--- a/src/joystick/windows/SDL_rawinputjoystick.c
+++ /dev/null
@@ -1,2240 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 2026 Sam Lantinga <slouken@libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-
-*/
-/*
-  RAWINPUT Joystick API for better handling XInput-capable devices on Windows.
-
-  XInput is limited to 4 devices.
-  Windows.Gaming.Input does not get inputs from XBox One controllers when not in the foreground.
-  DirectInput does not get inputs from XBox One controllers when not in the foreground, nor rumble or accurate triggers.
-  RawInput does not get rumble or accurate triggers.
-
-  So, combine them as best we can!
-*/
-#include "SDL_internal.h"
-
-#ifdef SDL_JOYSTICK_RAWINPUT
-
-#include "../usb_ids.h"
-#include "../SDL_sysjoystick.h"
-#include "../../core/windows/SDL_windows.h"
-#include "../../core/windows/SDL_hid.h"
-#include "../../core/windows/SDL_gameinput.h"
-#include "../hidapi/SDL_hidapijoystick_c.h"
-
-/* SDL_JOYSTICK_RAWINPUT_XINPUT is disabled because using XInput at the same time as
-   raw input will turn off the Xbox Series X controller when it is connected via the
-   Xbox One Wireless Adapter.
- */
-#ifdef HAVE_XINPUT_H
-#define SDL_JOYSTICK_RAWINPUT_XINPUT
-#endif
-#ifdef HAVE_WINDOWS_GAMING_INPUT_H
-#define SDL_JOYSTICK_RAWINPUT_WGI
-#endif
-
-#ifdef SDL_JOYSTICK_RAWINPUT_XINPUT
-#include "../../core/windows/SDL_xinput.h"
-#endif
-
-#ifdef SDL_JOYSTICK_RAWINPUT_WGI
-#include "../../core/windows/SDL_windows.h"
-struct WindowsGamingInputGamepadState;
-#define GamepadButtons_GUIDE 0x40000000
-#define COBJMACROS
-#include "windows.gaming.input.h"
-#include <roapi.h>
-#endif
-
-#if defined(SDL_JOYSTICK_RAWINPUT_XINPUT) || defined(SDL_JOYSTICK_RAWINPUT_WGI)
-#define SDL_JOYSTICK_RAWINPUT_MATCHING
-#define SDL_JOYSTICK_RAWINPUT_MATCH_AXES
-#define SDL_JOYSTICK_RAWINPUT_MATCH_TRIGGERS
-#ifdef SDL_JOYSTICK_RAWINPUT_MATCH_TRIGGERS
-#define SDL_JOYSTICK_RAWINPUT_MATCH_COUNT 6 // stick + trigger axes
-#else
-#define SDL_JOYSTICK_RAWINPUT_MATCH_COUNT 4 // stick axes
-#endif
-#endif
-
-#if 0
-#define DEBUG_RAWINPUT
-#endif
-
-#ifndef RIDEV_EXINPUTSINK
-#define RIDEV_EXINPUTSINK 0x00001000
-#define RIDEV_DEVNOTIFY   0x00002000
-#endif
-
-#ifndef WM_INPUT_DEVICE_CHANGE
-#define WM_INPUT_DEVICE_CHANGE 0x00FE
-#endif
-#ifndef WM_INPUT
-#define WM_INPUT 0x00FF
-#endif
-#ifndef GIDC_ARRIVAL
-#define GIDC_ARRIVAL 1
-#define GIDC_REMOVAL 2
-#endif
-
-extern void WINDOWS_RAWINPUTEnabledChanged(void);
-extern void WINDOWS_JoystickDetect(void);
-
-static bool SDL_RAWINPUT_inited = false;
-static bool SDL_RAWINPUT_remote_desktop = false;
-static int SDL_RAWINPUT_numjoysticks = 0;
-
-static void RAWINPUT_JoystickClose(SDL_Joystick *joystick);
-
-typedef struct SDL_RAWINPUT_Device
-{
-    SDL_AtomicInt refcount;
-    char *name;
-    char *path;
-    Uint16 vendor_id;
-    Uint16 product_id;
-    Uint16 version;
-    SDL_GUID guid;
-    bool is_xinput;
-    bool is_xboxone;
-    int steam_virtual_gamepad_slot;
-    PHIDP_PREPARSED_DATA preparsed_data;
-
-    HANDLE hDevice;
-    SDL_Joystick *joystick;
-    SDL_JoystickID joystick_id;
-
-    struct SDL_RAWINPUT_Device *next;
-} SDL_RAWINPUT_Device;
-
-struct joystick_hwdat

(Patch may be truncated, please check the link at the top of this post.)