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

@ -224,6 +224,7 @@
#define SDL_GetCurrentCameraDriver SDL_GetCurrentCameraDriver_REAL
#define SDL_GetCurrentDisplayMode SDL_GetCurrentDisplayMode_REAL
#define SDL_GetCurrentDisplayOrientation SDL_GetCurrentDisplayOrientation_REAL
#define SDL_GetCurrentKeymap SDL_GetCurrentKeymap_REAL
#define SDL_GetCurrentRenderOutputSize SDL_GetCurrentRenderOutputSize_REAL
#define SDL_GetCurrentThreadID SDL_GetCurrentThreadID_REAL
#define SDL_GetCurrentTime SDL_GetCurrentTime_REAL
@ -236,8 +237,6 @@
#define SDL_GetDaysInMonth SDL_GetDaysInMonth_REAL
#define SDL_GetDefaultAssertionHandler SDL_GetDefaultAssertionHandler_REAL
#define SDL_GetDefaultCursor SDL_GetDefaultCursor_REAL
#define SDL_GetDefaultKeyFromScancode SDL_GetDefaultKeyFromScancode_REAL
#define SDL_GetDefaultScancodeFromKey SDL_GetDefaultScancodeFromKey_REAL
#define SDL_GetDesktopDisplayMode SDL_GetDesktopDisplayMode_REAL
#define SDL_GetDirect3D9AdapterIndex SDL_GetDirect3D9AdapterIndex_REAL
#define SDL_GetDisplayBounds SDL_GetDisplayBounds_REAL
@ -354,6 +353,8 @@
#define SDL_GetKeyboardNameForID SDL_GetKeyboardNameForID_REAL
#define SDL_GetKeyboardState SDL_GetKeyboardState_REAL
#define SDL_GetKeyboards SDL_GetKeyboards_REAL
#define SDL_GetKeymapKeycode SDL_GetKeymapKeycode_REAL
#define SDL_GetKeymapScancode SDL_GetKeymapScancode_REAL
#define SDL_GetLogOutputFunction SDL_GetLogOutputFunction_REAL
#define SDL_GetLogPriority SDL_GetLogPriority_REAL
#define SDL_GetMasksForPixelFormat SDL_GetMasksForPixelFormat_REAL
@ -438,7 +439,6 @@
#define SDL_GetRendererProperties SDL_GetRendererProperties_REAL
#define SDL_GetRevision SDL_GetRevision_REAL
#define SDL_GetSIMDAlignment SDL_GetSIMDAlignment_REAL
#define SDL_GetScancodeFromKey SDL_GetScancodeFromKey_REAL
#define SDL_GetScancodeFromName SDL_GetScancodeFromName_REAL
#define SDL_GetScancodeName SDL_GetScancodeName_REAL
#define SDL_GetSemaphoreValue SDL_GetSemaphoreValue_REAL
@ -669,6 +669,7 @@
#define SDL_RegisterApp SDL_RegisterApp_REAL
#define SDL_RegisterEvents SDL_RegisterEvents_REAL
#define SDL_ReleaseCameraFrame SDL_ReleaseCameraFrame_REAL
#define SDL_ReleaseKeymap SDL_ReleaseKeymap_REAL
#define SDL_ReloadGamepadMappings SDL_ReloadGamepadMappings_REAL
#define SDL_RemovePath SDL_RemovePath_REAL
#define SDL_RemoveStoragePath SDL_RemoveStoragePath_REAL