logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

SDL_GetScancodeName - Get a human-readable name for a scancode.

Availability

       This function is available since SDL 3.2.0.

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.

Header File

       Defined in SDL3/SDL_keyboard.h

Name

       SDL_GetScancodeName - Get a human-readable name for a scancode.

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 ("").

See Also

(3), SDL_GetScancodeFromKey(3), (3), SDL_GetScancodeFromName(3), (3), SDL_SetScancodeName(3)

Simple Directmedia Layer                           SDL 3.2.10                             SDL_GetScancodeName(3)

Synopsis

#include"SDL3/SDL.h"constchar*SDL_GetScancodeName(SDL_Scancodescancode);

Thread Safety

       This function is not thread safe.

See Also