the gamepad API is far better than a “i have X buttons and Y axes” API and a gamepad-specific API for having good default mappings and consistent mappings from one gamepad to another and from one OS to another.
Some issues has already been addressed:
There is already someone assigned to this bugzilla, but I am willing to contribute if there are improvements which everyone agrees to.
I also would like to have more informations on some design decisions.
The current syntax does not allow mapping half an axis. On some controller the D-Pad is exposed as 2 axes, and the triggers are halves of the same axis.
Sometimes you also need to invert an axis.
There is a proposal to have a0+, a0- for halves and a0i (or !a0, ~a0) for an inverted axis.
This issue is addressed in the first two links.
There is someone assigned, but I have not seen anything new since november 2013.
They also discuss about dead zones. I am not sure if handling deadzones fits with the purpose of SDL2 GameController. The game could handle this.
We have some mappings defined in SDL_gamecontrollerdb.h, and the project SDL2 game controller. Do we need SDL_gamecontrollerdb.h, can’t we just use a text file, provided with the game, which will be easily updatable by the user ?
For now the controllers are identified by GUID, which is an OS-dependent number. So we have to provide mappings for every supported platform. The GUID contains the vendor id and the device id. We could provide mappings with the vendor id and the device id instead, assuming the OSes sees the buttons and the axes in the same order. We just have to take into account OS differences (d-pad as axes on Linux etc…). We could provide platform-specific mappings only when it’s needed.
Linux has an API which provides mappings in a way similar to SDL2 Gamepad.
We could use it to provide default mappings when it’s not provided by the database. We have to recognize if the mappings complies with the new API. If all buttons and axes used are contiguous, it’s likely that the driver did not map events according to the gamepad layout.
About the labels. For now we can show the Xbox equivalent, show generic button names, or both. We could add a field “labels:something”, which could be generic, xbox, playstation, etc… This field will just be ignored by the current version. We could just have a fixed set or another database containing the name and color of buttons.
Thoughts on those ?