Set event filter per device?

Hi,

I would like to receive only SDL_JOY* events when opening a device with the Joystick api (SDL_JoystickOpen) and receive only SDL_CONTROLLER* events when opening a device with the GameController api (SDL_GameControllerOpen).

When I open the device with the GameController api I receive events from both api. I was looking at the SDL_SetEventFilter but from what I understand it applies a filter for all events. Is there a way to filter events depending on if the device support GameController api or not? That way I don’t receive the same event twice with GameController api and can still check for Joystick events if the device was opened with that api.

You need to do that yourself. Game controller is working on top of Joystick API.
Just use SDL_GameControllerGetJoystick to get corresponding Joystick ID and filter events from joystick that you handling via JOY_* events.