---
name: "SDL_GetGamepadStringForButton"
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_GetGamepadStringForButton"
---

# SDL\_GetGamepadStringForButton(3)

Convert from an SDL\_GamepadButton enum to a string.

## NAME

SDL\_GetGamepadStringForButton - Convert from an  **SDL\_GamepadButton**\
  enum to a string.

## HEADER FILE

Defined in SDL3/SDL\_gamepad.h

## SYNOPSIS

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

**const char \* SDL\_GetGamepadStringForButton(SDL\_GamepadButton button);**

## FUNCTION PARAMETERS

- *button*

  an enum value for a given  **SDL\_GamepadButton** .

## RETURN VALUE

Returns a string for the given button, or NULL if an invalid button is specified. The string returned is of the format used by

**SDL\_Gamepad**\
  mapping strings.

## AVAILABILITY

This function is available since SDL 3.2.0.

## SEE ALSO

**•**(3), [**SDL\_GetGamepadButtonFromString**(3)](/SDL_GetGamepadButtonFromString/3.md)
