Exposed SDL_ResetKeyboard() as a public function

This will be used by Source 2 titles to reset keyboard state before showing assertion dialogs
This commit is contained in:
Sam Lantinga 2022-07-11 09:49:00 -07:00
parent 739155c44c
commit 2373da5d94
5 changed files with 15 additions and 3 deletions

View File

@ -90,9 +90,21 @@ extern DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void);
* \since This function is available since SDL 2.0.0.
*
* \sa SDL_PumpEvents
* \sa SDL_ResetKeyboard
*/
extern DECLSPEC const Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys);
/**
* Clear the state of the keyboard
*
* This function will generate key up events for all pressed keys.
*
* \since This function is available since SDL 2.24.0.
*
* \sa SDL_GetKeyboardState
*/
extern DECLSPEC void SDLCALL SDL_ResetKeyboard(void);
/**
* Get the current key modifier state for the keyboard.
*

View File

@ -852,3 +852,4 @@
# ++'_SDL_GDKGetTaskQueue'.'SDL2.dll'.'SDL_GDKGetTaskQueue'
# ++'_SDL_GDKRunApp'.'SDL2.dll'.'SDL_GDKRunApp'
++'_SDL_GetOriginalMemoryFunctions'.'SDL2.dll'.'SDL_GetOriginalMemoryFunctions'
++'_SDL_ResetKeyboard'.'SDL2.dll'.'SDL_ResetKeyboard'

View File

@ -878,3 +878,4 @@
#define SDL_GDKGetTaskQueue SDL_GDKGetTaskQueue_REAL
#define SDL_GDKRunApp SDL_GDKRunApp_REAL
#define SDL_GetOriginalMemoryFunctions SDL_GetOriginalMemoryFunctions_REAL
#define SDL_ResetKeyboard SDL_ResetKeyboard_REAL

View File

@ -961,3 +961,4 @@ SDL_DYNAPI_PROC(int,SDL_GDKGetTaskQueue,(XTaskQueueHandle *a),(a),return)
SDL_DYNAPI_PROC(int,SDL_GDKRunApp,(SDL_main_func a, void *b),(a,b),return)
#endif
SDL_DYNAPI_PROC(void,SDL_GetOriginalMemoryFunctions,(SDL_malloc_func *a, SDL_calloc_func *b, SDL_realloc_func *c, SDL_free_func *d),(a,b,c,d),)
SDL_DYNAPI_PROC(void,SDL_ResetKeyboard,(void),(),)

View File

@ -29,9 +29,6 @@
/* Initialize the keyboard subsystem */
extern int SDL_KeyboardInit(void);
/* Clear the state of the keyboard */
extern void SDL_ResetKeyboard(void);
/* Get the default keymap */
extern void SDL_GetDefaultKeymap(SDL_Keycode * keymap);