---
name: "SDL_GetJoystickFromPlayerIndex"
section: "3"
platform: "linux"
package: "libsdl3-doc"
version: "3.2.10+ds-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_GetJoystickFromPlayerIndex"
---

# SDL\_GetJoystickFromPlayerIndex(3)

Get the SDL\_Joystick associated with a player index.

## NAME

SDL\_GetJoystickFromPlayerIndex - Get the  **SDL\_Joystick**\
  associated with a player index.

## HEADER FILE

Defined in SDL3/SDL\_joystick.h

## SYNOPSIS

```
#include "SDL3/SDL.h"
```

**SDL\_Joystick \* SDL\_GetJoystickFromPlayerIndex(int player\_index);**

## FUNCTION PARAMETERS

- *player\_index*

  the player index to get the  **SDL\_Joystick**\
    for.

## RETURN VALUE

( **SDL\_Joystick**\
  \*) Returns an  **SDL\_Joystick**\
  on success or NULL on failure; call  **SDL\_GetError** () for more information.

## AVAILABILITY

This function is available since SDL 3.2.0.

## SEE ALSO

**•**(3), [**SDL\_GetJoystickPlayerIndex**(3)](/SDL_GetJoystickPlayerIndex/3.md), **•**(3), [**SDL\_SetJoystickPlayerIndex**(3)](/SDL_SetJoystickPlayerIndex/3.md)
