A few things.
I think it’d be neat if we added general controller type/labels to
controller definitions, to be used by games to decide what to call
various buttons. For example, if a game wants you to push the A button
to continue, with xbox360 labels it’d show a green A button, with
playstation/dualshock labels it’d show an X button, with SNES labels
it’d show a yellow B button. Internally, they’d all be handled as the
Xbox 360’s A button of course, it’d be a purely optional cosmetic thing.
Something like this:
SDL_Something SDL_GameControllerGetLabels (SDL_GameController*);
Should probably return an enum value, but a string would work too.
Another thing, has anyone thought of how Valve’s Steam controller will
work with SDL’s controller API? It doesn’t have the traditional face
buttons in the usual constellation, so a game depending on that layout
might want to map the buttons to clicks in the corresponding areas of
the right trackpad. However, a different game might want clicks on the
right trackpad to send stick-clicks instead, with ABXY mapped
differently. I know Valve’s going to have a config utility for
controller mappings, but that will probably only work with Steam games
I was thinking this could be solved with SDL hints, but we could also
add some functions to SDL that let games specify what inputs they’re
interested in (“i want two sticks, stick-clicks and a button”, or “i
want a dpad and 4 buttons (ABXY)”, etc). That would provide SDL with
enough information to select an appropriate mapping if several are
available, but it’d also come in handy for other types of controllers
that don’t have all the inputs available on an Xbox 360 pad. If a game
needs an analog stick, SDL could tell it that the SNES pad mapped to
input #0 won’t do, but the pad in #1 would work.
(Oh, also, can we be sure that all controllers of a particular type will
all have the same dead zone?)