Skip to content

Commit d2f6990

Browse files
committed
Send LI_CTYPE_STEAM for known Steam Controllers
1 parent 256022d commit d2f6990

2 files changed

Lines changed: 27 additions & 2 deletions

File tree

app/streaming/input/gamepad.cpp

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,32 @@ void SdlInputHandler::handleControllerDeviceEvent(SDL_ControllerDeviceEvent* eve
701701
type = LI_CTYPE_NINTENDO;
702702
break;
703703
default:
704-
type = LI_CTYPE_UNKNOWN;
704+
// These Steam Controller VID/PID combos come from SDL's controller_list.h
705+
// TODO: Use SDL_GAMEPAD_TYPE_STEAM on SDL 3.6+
706+
if (vendorId == 0x28de) {
707+
switch (productId) {
708+
case 0x1101:
709+
case 0x1102:
710+
case 0x1105:
711+
case 0x1106:
712+
case 0x1142:
713+
case 0x1201:
714+
case 0x1202:
715+
case 0x1205:
716+
case 0x1302:
717+
case 0x1303:
718+
case 0x1304:
719+
case 0x1305:
720+
type = LI_CTYPE_STEAM;
721+
break;
722+
default:
723+
type = LI_CTYPE_UNKNOWN;
724+
break;
725+
}
726+
}
727+
else {
728+
type = LI_CTYPE_UNKNOWN;
729+
}
705730
break;
706731
}
707732

0 commit comments

Comments
 (0)