SDL_GetJoystickPlayerIndex
Get the player index of an opened joystick.
- Provided by: libsdl3-doc (Version: 3.2.20+ds-2)
- Source: libsdl3
- Report a bug
Get the player index of an opened joystick.
#include <SDL3/SDL_joystick.h>
int SDL_GetJoystickPlayerIndex(SDL_Joystick *joystick);
For XInput controllers this returns the XInput user index. Many joysticks will not be able to supply this information.
Returns the player index, or -1 if it's not available.
This function is available since SDL 3.2.0.