Found it.
You are using gamepad events and sdl2 doesn’t have all the gamepad registered.
i added the following under sdlapplication
if (SDL_Init (SDL_INIT_VIDEO | SDL_INIT_GAMECONTROLLER | SDL_INIT_TIMER) != 0) {
printf ("Could not initialize SDL: %s.\n", SDL_GetError ());
}
//Add Logitech game pad
const char * CustomMappings = "030000006d04000016c2000010010000,Logitech Logitech Dual Action,platform:Linux,x:b0,a:b1,b:b2,y:b3,back:b8,start:b9,dpleft:h0.8,dpdown:h0.0,dpdown:h0.4,dpright:h0.0,dpright:h0.2,dpup:h0.0,dpup:h0.1,leftshoulder:h0.0,dpup:h0.1,leftshoulder:h0.0,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3";
if(SDL_GameControllerAddMapping(CustomMappings) == -1)
{
printf ("Could not Get Custom Mappings SDL: %s.\n", SDL_GetError ());
}
Then the gamepad events trigger.
if there a way to add the GameControllerDB through a text file that would be great. https://github.com/gabomdq/SDL_GameControllerDB
(with a way to add more since, i found at least one more mapping that needs to be added).
otherwise you have to add the mapping individually through the code like i did above.
Also it might be cool, if the gamepadevent didn’t trigger you could trigger the joystick event. Like in the joystick event
if (!SDL_IsGameController (event->cdevice.which)) { //SomeJoystickEventFires}
or something like that.