I fought the interface for about 30 minutes until I realised I need to turn off the auto-config before I plug it in.
I'd plug it in, and it was autoconfigured into a retarded state, and the cursor would fly everywhere and I'd be powerless to stop it, then I'd plug it out and the binds were automatically undone.
then I'd try a difference input driver, then it wouldn't see the controller at all, or it would see everything but the dpad, or recognise everything but the trigger buttons, etc, etc.
And it did this irrespective of whether I was using the xpad kernel driver, or the xboxdrv userspace driver for the controller itself (I use this one with --square-axis for PCSX2, so the corners are <1,1> instead of <0.7, 0.7>)
I've configured it to use SDL2 as the input driver, so it's definitely a retroarch issue.
I've SDL2 a bunch myself to add controller support to things, so let me tell you just how ridiculously easy it is to do:
SDL2 gained what is known as the 'gamecontroller' API (
https://wiki.libsdl.org/CategoryGameController).
If you want to use it, It is literally this easy if you don't care to support hotplugging or any other weird features (for hotplugging you'd need to track the device id, and listen for the plugged in and unplugged events in your eventloop)
Code:
for(int i = 0; i < SDL_NumJoysticks(); ++i)
{
if(!SDL_IsGameController(i)) continue;
SDL_GameControllerOpen(i)
}
You can even look at the enumerations and you'll see exactly what this API was made for:
here's the one for the axis
Code:
SDL_CONTROLLER_AXIS_INVALID
SDL_CONTROLLER_AXIS_LEFTX
SDL_CONTROLLER_AXIS_LEFTY
SDL_CONTROLLER_AXIS_RIGHTX
SDL_CONTROLLER_AXIS_RIGHTY
SDL_CONTROLLER_AXIS_TRIGGERLEFT
SDL_CONTROLLER_AXIS_TRIGGERRIGHT
SDL_CONTROLLER_AXIS_MAX
here's the one for the buttons
Code:
SDL_CONTROLLER_BUTTON_INVALID
SDL_CONTROLLER_BUTTON_A
SDL_CONTROLLER_BUTTON_B
SDL_CONTROLLER_BUTTON_X
SDL_CONTROLLER_BUTTON_Y
SDL_CONTROLLER_BUTTON_BACK
SDL_CONTROLLER_BUTTON_GUIDE
SDL_CONTROLLER_BUTTON_START
SDL_CONTROLLER_BUTTON_LEFTSTICK
SDL_CONTROLLER_BUTTON_RIGHTSTICK
SDL_CONTROLLER_BUTTON_LEFTSHOULDER
SDL_CONTROLLER_BUTTON_RIGHTSHOULDER
SDL_CONTROLLER_BUTTON_DPAD_UP
SDL_CONTROLLER_BUTTON_DPAD_DOWN
SDL_CONTROLLER_BUTTON_DPAD_LEFT
SDL_CONTROLLER_BUTTON_DPAD_RIGHT
SDL_CONTROLLER_BUTTON_MAX
It's so ridiculously easy to use, I don't see how this can even be an issue, but yet it is.