---
name: "SDL_GetScancodeName"
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_GetScancodeName"
---

# SDL\_GetScancodeName(3)

Get a human-readable name for a scancode.

## NAME

SDL\_GetScancodeName - Get a human-readable name for a scancode.

## HEADER FILE

Defined in SDL3/SDL\_keyboard.h

## SYNOPSIS

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

**const char \* SDL\_GetScancodeName(SDL\_Scancode scancode);**

## DESCRIPTION

**Warning** : The returned name is by design not stable across platforms, e.g. the name for  **SDL\_SCANCODE\_LGUI** is "Left GUI" under Linux but "Left Windows" under Microsoft Windows, and some scancodes like  **SDL\_SCANCODE\_NONUSBACKSLASH** don't have any name at all. There are even scancodes that share names, e.g.

**SDL\_SCANCODE\_RETURN** and

**SDL\_SCANCODE\_RETURN2** (both called "Return"). This function is therefore unsuitable for creating a stable cross-platform two-way mapping between strings and scancodes.

## FUNCTION PARAMETERS

- *scancode*

  the desired  **SDL\_Scancode**\
    to query.

## RETURN VALUE

Returns a pointer to the name for the scancode. If the scancode doesn't have a name this function returns an empty string ("").

## THREAD SAFETY

This function is not thread safe.

## AVAILABILITY

This function is available since SDL 3.2.0.

## SEE ALSO

**•**(3), [**SDL\_GetScancodeFromKey**(3)](/SDL_GetScancodeFromKey/3.md), **•**(3), [**SDL\_GetScancodeFromName**(3)](/SDL_GetScancodeFromName/3.md), **•**(3), [**SDL\_SetScancodeName**(3)](/SDL_SetScancodeName/3.md)
