Add DSU joystick driver
Introduces DSU client joystick support for SDL, enabling connection to DSU servers (such as DS4Windows and BetterJoy) to receive controller data over UDP, including motion sensors and touchpad data. Adds build system options, configuration hints, protocol implementation, and driver integration for Windows and other platforms.
Here is a tidy-up patch that makes things build for me: dsu.patch
- DSU_ReceiverThread() must be marked as SDLCALL
- the
libpragma is for MSVC only: others need ws2_32 in link libraries - socket type isn't int for windows: it is UINT_PTR, i.e. word-size it is word size dependent
- winsock2.h must be included before windows.h (other headers might pull it in), otherwise windows.h pulls in winsock.h, instead.
- winsock2 already has socklen_t type in SDKs that are supported by SDL.
- adds new dsu sources to Makefile.w32 for watcom/windows.
There still are more work to do, e.g. autotools integration (since you are doing this for SDL2), addition of new sources to MSVC project files and to Android.mk, etc: I didn't bother, yet.
I also didn't bother for os/2 support (SDL2 does support os2) either (probably it's not worth the effort...)
This won't be accepted for SDL2, but you could create a PR against main for review after 3.4 ships.
This won't be accepted for SDL2, but you could create a PR against main for review after 3.4 ships.
No way to make you change your mind on this? I dont mind doing this for SDL3 too and I know SDL2 is maintenance mode now but I was mainly doing this for UWP/XBOX and other platforms that dont support 3rd party devices, touch, gyro etc will have a nice workaround but with UWP support gone in SDL3 it would be nice to have this in SDL2
Can you actually run DSU servers on Xbox?
Let's get it in SDL3 and work out the kinks, and then we can evaluate how valuable it is to backport.
Yes DSU does work on Xbox, anyway I made a PR for SDL3