Game: Xbox One S controller connected through SDL but gives no input on Windows (rc.4); HOS_XINPUT=1 works #726

Open
opened 2026-11-15 06:40:42 +00:00 by dukenheimer · 0 comments
Contributor

What happens: on v3.0.0-rc.4 (source b784a40c) an Xbox One S controller does nothing in the game, while the keyboard and mouse work. SDL finds the controller and has a mapping for it, but no input from it reaches the game.

System: Windows 11 Pro (build 26300), RTX 5090 (NVIDIA 621.14), Xbox One S Controller (guid 030000005e040000200b000011057200). Steam not running. The game window was in front (the log shows hid: game window in front).

Log (longshot_log.txt):

hid: SDL controller support ready (DualSense, DualShock 4, Switch Pro, Xbox and others)
hid: controller "Xbox One S Controller" connected (SDL); guid=030000005e040000200b000011057200; mapping=available; mapping-name="*"
hid: guid=030000005e040000200b000011057200; mapping-string[1/1]="030000005e040000200b000011057200,*,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,platform:Windows"
hid: 1 controller through SDL

Checked:

  • Windows' XInput sees the controller: XInputGetState(0) returns connected, with a packet number that keeps rising while it's used.
  • Because SDL has an open controller, host/nn_hid.c doesn't poll XInput (if (!sdl_pads || poll_xinput_env)), so nothing reads it.
  • Controls in longshot_options.ini are the defaults (pad_a=1 … pad_down=12).

Workaround: HOS_XINPUT=1 in longshot_env.txt brings the controller back.

Notes:

  • The mapping string above reads the controller as a DirectInput-style device (dpup:h0.1, axes a0–a5), not through SDL's XInput/HIDAPI drivers. That may be why SDL reports it connected but gets no input.
  • Earlier in the same session, another SDL program (window class SDL_app) briefly took the foreground. It was gone during the failing run.
  • This PC's earlier build (main 543846eb) wasn't tested with the controller, so I can't say whether rc.4 changed this.

Possible fix (a suggestion, not tested): fall back to XInput when an SDL controller has sent no input for a while but XInput reports a pad in the same slot.

**What happens:** on v3.0.0-rc.4 (source b784a40c) an Xbox One S controller does nothing in the game, while the keyboard and mouse work. SDL finds the controller and has a mapping for it, but no input from it reaches the game. **System:** Windows 11 Pro (build 26300), RTX 5090 (NVIDIA 621.14), Xbox One S Controller (guid 030000005e040000200b000011057200). Steam not running. The game window was in front (the log shows `hid: game window in front`). **Log (longshot_log.txt):** ``` hid: SDL controller support ready (DualSense, DualShock 4, Switch Pro, Xbox and others) hid: controller "Xbox One S Controller" connected (SDL); guid=030000005e040000200b000011057200; mapping=available; mapping-name="*" hid: guid=030000005e040000200b000011057200; mapping-string[1/1]="030000005e040000200b000011057200,*,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,platform:Windows" hid: 1 controller through SDL ``` **Checked:** - Windows' XInput sees the controller: `XInputGetState(0)` returns connected, with a packet number that keeps rising while it's used. - Because SDL has an open controller, host/nn_hid.c doesn't poll XInput (`if (!sdl_pads || poll_xinput_env)`), so nothing reads it. - Controls in longshot_options.ini are the defaults (pad_a=1 … pad_down=12). **Workaround:** `HOS_XINPUT=1` in longshot_env.txt brings the controller back. **Notes:** - The mapping string above reads the controller as a DirectInput-style device (`dpup:h0.1`, axes a0–a5), not through SDL's XInput/HIDAPI drivers. That may be why SDL reports it connected but gets no input. - Earlier in the same session, another SDL program (window class `SDL_app`) briefly took the foreground. It was gone during the failing run. - This PC's earlier build (main 543846eb) wasn't tested with the controller, so I can't say whether rc.4 changed this. **Possible fix (a suggestion, not tested):** fall back to XInput when an SDL controller has sent no input for a while but XInput reports a pad in the same slot.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot#726
No description provided.