I intend to work on the following additions to SDL’s Joystick/GameController system and thought I’d seek opinions before I start, to make sure these would actually be welcomed and likely to be merged:
Extend the GameController API to support haptic feedback on analogue triggers (essentially an extra couple of rumble motors)
Use Windows.Gaming.Input APIs for Xbox One controllers on Windows 10, as a replacement for XInput, in order to implement the above
Extend the GameController API to support motion controls (gyroscope and accelerometer)
Implement 3) for PS4 controllers (and maybe Switch too)
I’m slightly concerned about 2) as I’m unsure whether WGI supports background input. Any comments welcomed.
Yes, yes, and yes Especially 3. There are many Game controllers that come with gyroscopes and accelerometers, gyro aiming is superior to thumb sticks. This is why I just downloaded and was taking a look at SDL. Intention was to make a remapping tool so I could use my generic switch pro controller for gyro aiming. If it can be done another way - let me know, would be appreciated.
Getting 3rd part controllers to use this is not that easy. At least SDL can recognise the controllers standard buttons presently.
Happy to see interest in this! My first pass at adding motion data to the gamepad API was in October but it wasn’t accepted (received helpful feedback about the design but I didn’t have time to redo it). I ended up just using a custom hidapi-based solution for my project since I didn’t want to maintain an SDL fork.
meyraud705’s version from March (linked above) is a better approach than mine and implements it for PS4 pads. Fingers crossed it can be merged… I think gyro aiming could be a lot more common in PC games if support is available in a popular library like SDL.