---
name: "SDL_GetJoystickID"
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_GetJoystickID"
---

# SDL\_GetJoystickID(3)

Get the instance ID of an opened joystick.

## NAME

SDL\_GetJoystickID - Get the instance ID of an opened joystick.

## HEADER FILE

Defined in SDL3/SDL\_joystick.h

## SYNOPSIS

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

**SDL\_JoystickID SDL\_GetJoystickID(SDL\_Joystick \*joystick);**

## FUNCTION PARAMETERS

- *joystick*

  an  **SDL\_Joystick**\
    structure containing joystick information.

## RETURN VALUE

( **SDL\_JoystickID** ) Returns the instance ID of the specified joystick on success or 0 on failure; call  **SDL\_GetError** () for more information.

## AVAILABILITY

This function is available since SDL 3.2.0.
