---
name: "SDL_GetGamepadConnectionState"
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_GetGamepadConnectionState"
---

# SDL\_GetGamepadConnectionState(3)

Get the connection state of a gamepad.

## NAME

SDL\_GetGamepadConnectionState - Get the connection state of a gamepad.

## HEADER FILE

Defined in SDL3/SDL\_gamepad.h

## SYNOPSIS

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

**SDL\_JoystickConnectionState SDL\_GetGamepadConnectionState(SDL\_Gamepad \*gamepad);**

## FUNCTION PARAMETERS

- *gamepad*

  the gamepad object 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.
