SDL_GetKeyFromScancode - Get the key code corresponding to the given scancode according to the current
Contents
Availability
This function is available since SDL 3.2.0.
Description
If you want to get the keycode as it would be delivered in key events, including options specified in
SDL_HINT_KEYCODE_OPTIONS , then you should pass key_event as true. Otherwise this function simply
translates the scancode based on the given modifier state.
Function Parameters
scancode
the desired SDL_Scancode
to query.
modstate
the modifier state to use when translating the scancode to a keycode.
key_event
true if the keycode will be used in key events.
Header File
Defined in SDL3/SDL_keyboard.h
Name
SDL_GetKeyFromScancode - Get the key code corresponding to the given scancode according to the current
keyboard layout.
Return Value
( SDL_Keycode ) Returns the SDL_Keycode
that corresponds to the given SDL_Scancode .
See Also
•(3), SDL_GetKeyName(3), •(3), SDL_GetScancodeFromKey(3) Simple Directmedia Layer SDL 3.2.10 SDL_GetKeyFromScancode(3)
Synopsis
#include"SDL3/SDL.h"SDL_KeycodeSDL_GetKeyFromScancode(SDL_Scancodescancode,SDL_Keymodmodstate,boolkey_event);
Thread Safety
This function is not thread safe.
