Ancurio/mkxp — pull request #86 by Daverball (2014-12-30 16:54:17+00:00)
Title: More consistent controller support via SDL_GameController

Controllers are one of the things that are a huge mess, especially across multiple platforms, so using SDL_joystick on its own is often not enough to get consistent behaviour across different gamepads and operating systems.

This is why SDL_GameController is a thing, it works on top of SDL_joystick. It takes community sourced mappings to map all joystick buttons to a generic controller that looks like an xbox gamepad, if an application is launched via Steam, Steam will also automatically pass controller bindings that have been previously setup in big picture mode for the connected gamepads.

I haven't looked into how much code would have to be changed to make this work, but it seems manageable and I will probably get started on a patch to implement this soon, I think the benefits definitely would outweigh the amount of work it is to port it over from pure SDL_joystick to SDL_GameController.

The main motivation for this is, that MKXP already doesn't handle all controller buttons on all operating systems, and there's also differences in the button enumeration across different drivers, Xbox controllers for example will not let you assign the dpad on Windows because it's mapped to a weird thing that's neither a button nor an axis.