---
name: "SDL_GetGamepadMapping"
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_GetGamepadMapping"
---

# SDL\_GetGamepadMapping(3)

Get the current mapping of a gamepad.

## NAME

SDL\_GetGamepadMapping - Get the current mapping of a gamepad.

## HEADER FILE

Defined in SDL3/SDL\_gamepad.h

## SYNOPSIS

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

**char \* SDL\_GetGamepadMapping(SDL\_Gamepad \*gamepad);**

## DESCRIPTION

Details about mappings are discussed with

**SDL\_AddGamepadMapping** ().

## FUNCTION PARAMETERS

- *gamepad*

  the gamepad you want to get the current mapping for.

## RETURN VALUE

Returns a string that has the gamepad's mapping or NULL if no mapping is available; call  **SDL\_GetError** () for more information. This should be freed with  **SDL\_free** () when it is no longer needed.

## AVAILABILITY

This function is available since SDL 3.2.0.

## SEE ALSO

**•**(3), [**SDL\_AddGamepadMapping**(3)](/SDL_AddGamepadMapping/3.md), **•**(3), [**SDL\_GetGamepadMappingForID**(3)](/SDL_GetGamepadMappingForID/3.md), **•**(3), [**SDL\_GetGamepadMappingForGUID**(3)](/SDL_GetGamepadMappingForGUID/3.md), **•**(3), [**SDL\_SetGamepadMapping**(3)](/SDL_SetGamepadMapping/3.md)
