The keycode in key events is the base, unmodified, keycode for the current keyboard layout

This commit is contained in:
Sam Lantinga
2024-06-30 19:58:48 -07:00
parent 5755bde3b8
commit d9dc4b320a
15 changed files with 125 additions and 160 deletions

View File

@@ -315,6 +315,11 @@ typedef struct SDL_KeyboardDeviceEvent
/**
* Keyboard button event structure (event.key.*)
*
* The `key` is the base SDL_Keycode generated by pressing the `scancode` using the current keyboard layout, applying any options specified in SDL_HINT_KEYCODE_OPTIONS. You can get the SDL_Keycode corresponding to the event scancode and modifiers directly from the keyboard layout, bypassing SDL_HINT_KEYCODE_OPTIONS, by calling SDL_GetKeyFromScancode().
*
* \sa SDL_GetKeyFromScancode
* \sa SDL_HINT_KEYCODE_OPTIONS
*
* \since This struct is available since SDL 3.0.0.
*/
typedef struct SDL_KeyboardEvent