---
name: "SDL_GetJoystickConnectionState"
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_GetJoystickConnectionState"
---

# SDL\_GetJoystickConnectionState(3)

Get the connection state of a joystick.

## NAME

SDL\_GetJoystickConnectionState - Get the connection state of a joystick.

## HEADER FILE

Defined in SDL3/SDL\_joystick.h

## SYNOPSIS

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

**SDL\_JoystickConnectionState SDL\_GetJoystickConnectionState(SDL\_Joystick \*joystick);**

## FUNCTION PARAMETERS

- *joystick*

  the joystick to query.

## RETURN VALUE

( **SDL\_JoystickConnectionState** ) Returns the connection state on success or

**SDL\_JOYSTICK\_CONNECTION\_INVALID** on failure; call  **SDL\_GetError** () for more information.

## AVAILABILITY

This function is available since SDL 3.2.0.
