---
name: "SDL_GetGamepadSensorData"
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_GetGamepadSensorData"
---

# SDL\_GetGamepadSensorData(3)

Get the current state of a gamepad sensor.

## NAME

SDL\_GetGamepadSensorData - Get the current state of a gamepad sensor.

## HEADER FILE

Defined in SDL3/SDL\_gamepad.h

## SYNOPSIS

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

**bool SDL\_GetGamepadSensorData(SDL\_Gamepad \*gamepad, SDL\_SensorType type, float \*data, int num\_values);**

## DESCRIPTION

The number of values and interpretation of the data is sensor dependent. See  **SDL\_sensor** .h for the details for each type of sensor.

## FUNCTION PARAMETERS

- *gamepad*

  the gamepad to query.

- *type*

  the type of sensor to query.

- *data*

  a pointer filled with the current sensor state.

- *num\_values*

  the number of values to write to data.

## 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.
