Added SDL_GetDefaultKeyFromScancode() to the public API

This is useful when getting the English name of a key for a non-Latin keyboard layout, for example.
This commit is contained in:
Sam Lantinga 2024-05-28 19:47:17 -07:00
parent aeb223fc23
commit 542a3663de
4 changed files with 18 additions and 0 deletions

View file

@ -202,6 +202,21 @@ extern SDL_DECLSPEC SDL_Keymod SDLCALL SDL_GetModState(void);
*/
extern SDL_DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate);
/**
* Get the key code corresponding to the given scancode according to a default en_US keyboard layout.
*
* See SDL_Keycode for details.
*
* \param scancode the desired SDL_Scancode to query
* \returns the SDL_Keycode that corresponds to the given SDL_Scancode.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetKeyName
* \sa SDL_GetScancodeFromKey
*/
extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetDefaultKeyFromScancode(SDL_Scancode scancode);
/**
* Get the key code corresponding to the given scancode according to the
* current keyboard layout.