Skip to content

Commit 7a2dc6f

Browse files
committed
Report Valve (Steam) controllers as Xbox type to the host
SDL has no gamepad type for Steam Controllers, so they arrived as LI_CTYPE_UNKNOWN with gyro/accel/touchpad capabilities and Sunshine's auto mode emulated a DualShock. Report LI_CTYPE_XBOX for vendor 0x28de so the host emulates an X360 pad matching the controller's layout.
1 parent 256022d commit 7a2dc6f

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

app/streaming/input/gamepad.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,20 @@ void SdlInputHandler::handleControllerDeviceEvent(SDL_ControllerDeviceEvent* eve
701701
type = LI_CTYPE_NINTENDO;
702702
break;
703703
default:
704-
type = LI_CTYPE_UNKNOWN;
704+
// SDL has no gamepad type for Valve's Steam Controllers (the 2nd-gen
705+
// 2026 model and its Proteus/Nereid wireless dongle included), so they
706+
// land here as UNKNOWN while still advertising gyro/accel/touchpad
707+
// capabilities. Sunshine's "auto" gamepad selection treats an unknown
708+
// pad with motion/touchpad caps as a DualShock and emulates a PS
709+
// controller on the host. The Steam Controller has an Xbox-style
710+
// layout (ABXY, Menu/View, analog triggers), so tell the host it's an
711+
// Xbox pad and let it emulate an X360/XInput device instead.
712+
if (vendorId == 0x28de) {
713+
type = LI_CTYPE_XBOX;
714+
}
715+
else {
716+
type = LI_CTYPE_UNKNOWN;
717+
}
705718
break;
706719
}
707720

0 commit comments

Comments
 (0)