SDL_GetKeyFromScancode(3)

SDL_GetKeyFromScancode3

Get the key code corresponding to the given scancode according to the current keyboard layout.

Usage

#include "SDL3/SDL.h"

SDL_Keycode SDL_GetKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate, bool key_event);

Header file

Defined in SDL3/SDL_keyboard.h

Overview

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.

Return value

( SDL_Keycode ) Returns the SDL_Keycode
that corresponds to the given SDL_Scancode .

Thread safety

This function is not thread safe.

Availability

This function is available since SDL 3.2.0.

From libsdl3-doc 3.2.10+ds-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.