Wiki Page Content



Use this function to get a human-readable name for a scancode.


const char* SDL_GetScancodeName(SDL_Scancode scancode)

Function Parameters


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

Code Examples

You can add your code example here


See SDL_Scancode for details.

/!\ 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.


This function is available since SDL 2.0.0.

CategoryAPI, CategoryKeyboard

None: SDL_GetScancodeName (last edited 2016-10-21 22:04:39 by PhilippWiesemann)

Please include your contact information if you'd like to receive a reply.