From 92888b515c0346691bf586d6b386a0967fc67a56 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Mon, 5 Aug 2024 19:48:01 -0700
Subject: [PATCH] Updated for the SDL3 keyboard changes
---
src/sdl2_compat.c | 2 +-
src/sdl3_include_wrapper.h | 10 ----------
src/sdl3_syms.h | 2 +-
3 files changed, 2 insertions(+), 12 deletions(-)
diff --git a/src/sdl2_compat.c b/src/sdl2_compat.c
index 21bf8f5..c7b2b46 100644
--- a/src/sdl2_compat.c
+++ b/src/sdl2_compat.c
@@ -1697,7 +1697,7 @@ SDL_GetKeyFromScancode(SDL2_Scancode scancode)
if (scancode <= SDL2_SCANCODE_MODE) {
// They're the same
- return SDL3_GetKeyFromScancode(SDL2ScancodeToSDL3Scancode(scancode), SDL_KMOD_NONE);
+ return SDL3_GetKeyFromScancode(SDL2ScancodeToSDL3Scancode(scancode), SDL_KMOD_NONE, SDL_TRUE);
} else {
return SDL_SCANCODE_TO_KEYCODE(scancode);
}
diff --git a/src/sdl3_include_wrapper.h b/src/sdl3_include_wrapper.h
index fe64988..3b9a912 100644
--- a/src/sdl3_include_wrapper.h
+++ b/src/sdl3_include_wrapper.h
@@ -243,8 +243,6 @@
#define SDL_GetDaysInMonth IGNORE_THIS_VERSION_OF_SDL_GetDaysInMonth
#define SDL_GetDefaultAssertionHandler IGNORE_THIS_VERSION_OF_SDL_GetDefaultAssertionHandler
#define SDL_GetDefaultCursor IGNORE_THIS_VERSION_OF_SDL_GetDefaultCursor
-#define SDL_GetDefaultKeyFromScancode IGNORE_THIS_VERSION_OF_SDL_GetDefaultKeyFromScancode
-#define SDL_GetDefaultScancodeFromKey IGNORE_THIS_VERSION_OF_SDL_GetDefaultScancodeFromKey
#define SDL_GetDesktopDisplayMode IGNORE_THIS_VERSION_OF_SDL_GetDesktopDisplayMode
#define SDL_GetDirect3D9AdapterIndex IGNORE_THIS_VERSION_OF_SDL_GetDirect3D9AdapterIndex
#define SDL_GetDisplayBounds IGNORE_THIS_VERSION_OF_SDL_GetDisplayBounds
@@ -1965,14 +1963,6 @@
#undef SDL_GetDefaultCursor
#endif
-#ifdef SDL_GetDefaultKeyFromScancode
-#undef SDL_GetDefaultKeyFromScancode
-#endif
-
-#ifdef SDL_GetDefaultScancodeFromKey
-#undef SDL_GetDefaultScancodeFromKey
-#endif
-
#ifdef SDL_GetDesktopDisplayMode
#undef SDL_GetDesktopDisplayMode
#endif
diff --git a/src/sdl3_syms.h b/src/sdl3_syms.h
index 524ce85..57e566d 100644
--- a/src/sdl3_syms.h
+++ b/src/sdl3_syms.h
@@ -216,7 +216,7 @@ SDL3_SYM_PASSTHROUGH(SDL_Window*,GetKeyboardFocus,(void),(),return)
SDL3_SYM_PASSTHROUGH(const Uint8*,GetKeyboardState,(int *a),(a),return)
SDL3_SYM(SDL_Keymod,GetModState,(void),(),return)
SDL3_SYM(void,SetModState,(SDL_Keymod a),(a),)
-SDL3_SYM(SDL_Keycode,GetKeyFromScancode,(SDL_Scancode a, SDL_Keymod b),(a,b),return)
+SDL3_SYM(SDL_Keycode,GetKeyFromScancode,(SDL_Scancode a, SDL_Keymod b, SDL_bool c),(a,b,c),return)
SDL3_SYM(SDL_Scancode,GetScancodeFromKey,(SDL_Keycode a, SDL_Keymod *b),(a,b),return)
SDL3_SYM(const char*,GetScancodeName,(SDL_Scancode a),(a),return)
SDL3_SYM(SDL_Scancode,GetScancodeFromName,(const char *a),(a),return)