Feature Request: Use SDL3 as a backend for the GameInput shim (multi-controller, trigger rumble, and gyro support) #692
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl#692
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Kabosune on GitHub · 2026-11-24 03:33 UTC · original
Hi! Since XCL currently backs its
GameInputimplementation with XInput (plus keyboard/mouse mapped as a gamepad inxcl.toml), would you consider adding an SDL3 backend for theGameInputlayer?Why SDL3
SDL_RumbleGamepadTriggers), haptics, LEDs, and touchpad input through one unified API.SDL_SENSOR_GYRO/SDL_SENSOR_ACCELacross supported controllers, whereas XInput has no sensor support and Windows GameInput doesn't expose gyro on most third-party controllers.Optional Gyro Aiming (
xcl.toml)Simply swapping the
GameInputbackend to SDL3 won't automatically give console titles gyro aiming (since Xbox binaries generally don't readGameInputMotionStatefor camera control), so this splits cleanly into two parts:GameInputshim with SDL3 for broad controller support, trigger rumble, and sensor access.SDL_SENSOR_GYROdeltas into the right-stick / aiming input (similar to XCL's existing mouse-to-right-stick path inxcl.toml), with simple config options for sensitivity and activation (e.g., active while holding LT/L2).Thanks for all the work on XCL!
@vakaobr on GitHub · 2026-11-24 12:20 UTC · original
I looked at the open PRs that touch GameInput (#552, #565, #709, #710, #715, #731, #893) and at what SDL3 would add on top of them. DualShock 4 / DualSense input is already covered by #552, and #731 goes deeper on DualSense output (adaptive triggers, WASAPI haptics) than SDL3 can. XInput handles Xbox controllers.
What SDL3 uniquely provides is gyro/accel sensor data (
SDL_GetGamepadSensorData) and support for controllers nothing else covers (Switch Pro, Steam Controller/Deck). I plan to add it as an optional sensor and extra-controller path, not a full backend replacement, loaded at runtime with no build-time dependency. The work is split into four PRs: (1) the gyro-to-stick mapping logic and config, (2) SDL3 dynamic loading and sensor reading, (3) SDL3 as a fallback for unsupported controllers, (4) diagnostics. Each is under ~400 lines, default-off, and stacked.@Kabosune on GitHub · 2026-11-24 16:21 UTC · original
Thanks for digging through the open PRs. One concern about relying on the HID path (#552/#731) for PlayStation controllers: it's USB-only for DualSense, and most players use it over Bluetooth. Its DualSense input has also only been checked against a unit test, not a real controller. SDL3 already handles the DualSense/DS4 Bluetooth report formats (including the checksums on output reports), controller revisions, and hotplug, and it's maintained upstream. It also covers Switch Pro, Joy-Con, 8BitDo and others with the same code, so XCL doesn't need a separate parser for each vendor. Adaptive-trigger effects are possible through
SDL_SendGamepadEffecttoo.Would you consider making SDL3 (when the DLL is present) the main path for non-XInput controllers, and keeping the direct HID code for what SDL can't do, like #731's audio-driven haptics, or as a fallback when SDL3 isn't installed? That would give Bluetooth DualSense, gyro, and broad controller support in one place, without maintaining HID parsers for every controller.