From 1915b5c1bf83dfcf3f82507eeee7fa4146ba3ef2 Mon Sep 17 00:00:00 2001 From: Matthew Stanley <1379tech@gmail.com> Date: Thu, 25 Jun 2026 13:21:38 -0700 Subject: [PATCH] input: enable SDL HIDAPI Xbox driver so Xbox One/Series pads work The runtime forces SDL HIDAPI (SDL_HINT_JOYSTICK_HIDAPI=1) and disables RAWINPUT (=0) so Steam's injected virtual Xbox controller enumerates as a GameController. But HIDAPI's Xbox sub-driver is OFF by default on Windows (Xbox pads are normally RAWINPUT/XInput there), so with RAWINPUT disabled a PHYSICAL Xbox One/Series controller was claimed by no GameController driver at all -> SDL_IsGameController false -> never opened -> zero button input. PS5 DualSense was unaffected (its HIDAPI driver is on by default), which is why PS5 worked and Xbox did not. Fix: enable SDL_HINT_JOYSTICK_HIDAPI_XBOX so HIDAPI also claims Xbox pads, keeping the HIDAPI-preferred design (and avoiding the RAWINPUT+HIDAPI Xbox double-enumerate the author was avoiding). Additive hint; no effect on the working PS5 path. Co-Authored-By: Claude Opus 4.8 --- runtime/src/main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/runtime/src/main.cpp b/runtime/src/main.cpp index ccaac327..79c99e0f 100644 --- a/runtime/src/main.cpp +++ b/runtime/src/main.cpp @@ -2429,6 +2429,12 @@ int main(int argc, char** argv) { * as a game controller rather than a raw HID device. */ SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI, "1"); SDL_SetHint(SDL_HINT_JOYSTICK_RAWINPUT, "0"); + /* ...but HIDAPI's Xbox sub-driver is OFF by default on Windows (Xbox pads are + * normally RAWINPUT/XInput there). With RAWINPUT disabled above, a PHYSICAL + * Xbox One/Series controller would be claimed by nobody -> not a GameController + * -> zero input (PS5 DualSense works regardless: its HIDAPI driver is on by + * default). Enable the HIDAPI Xbox driver so HIDAPI handles Xbox pads too. */ + SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_XBOX, "1"); if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_GAMECONTROLLER) != 0) { std::fprintf(stderr, "SDL_Init failed: %s\n", SDL_GetError()); return 1;