Sunday, October 27, 2013

DualShock 4 for SDL layout.

Here's a quick dump of getting DualShock 4 support in your SDL title that should work for SDL 1.2 and 2.0. If you're not using the controller mapping in SDL ( like for Steam OS titles ), but want to do it old-school here's the button layout in SDL terms:

You can detect the pad via the string "Sony Computer Entertainment Wireless Controller". Here's a dump from Linux dmesg for more USB details if you want to fingerprint: