Expose the keymap separately from the event keycode

This adds functions to query the keymap:
* SDL_GetCurrentKeymap()
* SDL_GetKeymapKeycode()
* SDL_GetKeymapScancode()
* SDL_ReleaseKeymap()

and these are distinct from the function to query the event keycode associated with a scancode, which might be affected by SDL_HINT_KEYCODE_OPTIONS.

Also added an SDL_bool parameter to SDL_GetKeyName() and SDL_GetKeyFromName() to enable upper case handling of the name.
This commit is contained in:
Sam Lantinga 2024-08-05 16:37:24 -07:00
parent d68d32e12c
commit c298a3749b
15 changed files with 241 additions and 191 deletions

View file

@ -1717,7 +1717,7 @@ void SDLTest_PrintEvent(const SDL_Event *event)
event->key.windowID,
event->key.scancode,
SDL_GetScancodeName(event->key.scancode),
event->key.key, SDL_GetKeyName(event->key.key),
event->key.key, SDL_GetKeyName(event->key.key, SDL_TRUE),
modstr);
break;
}