Function SDL_SetJoystickPlayerIndex

pub unsafe extern "C" fn SDL_SetJoystickPlayerIndex(
    joystick: *mut SDL_Joystick,
    player_index: i32,
) -> bool
Available on crate feature dep_sdl3 only.
Expand description

Set the player index of an opened joystick.

§Parameters

  • joystick: the SDL_Joystick obtained from SDL_OpenJoystick().
  • player_index: player index to assign to this joystick, or -1 to clear the player index and turn off player LEDs.

§Return value

Returns true on success or false on failure; call SDL_GetError() for more information.

§Availability

This function is available since SDL 3.2.0.

§See also