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

@@ -1209,7 +1209,7 @@ int main(int argc, char *argv[])
event.key.scancode,
SDL_GetScancodeName(event.key.scancode),
SDL_static_cast(Uint32, event.key.key),
SDL_GetKeyName(event.key.key));
SDL_GetKeyName(event.key.key, SDL_TRUE));
break;
}
case SDL_EVENT_TEXT_INPUT: {