Initial support for hotplugging mice and keyboards

This commit is contained in:
Sam Lantinga
2024-03-20 06:58:00 -07:00
parent c33e4c998d
commit 2fe1a6a279
44 changed files with 961 additions and 321 deletions

View File

@@ -39,6 +39,8 @@
extern "C" {
#endif
typedef Uint32 SDL_KeyboardID;
/**
* The SDL keysym structure, used in key events.
*
@@ -54,6 +56,31 @@ typedef struct SDL_Keysym
/* Function prototypes */
/**
* Return whether a keyboard is currently connected.
*
* \returns SDL_TRUE if a keyboard is connected, SDL_FALSE otherwise.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetKeyboards
*/
extern DECLSPEC SDL_bool SDLCALL SDL_HasKeyboard(void);
/**
* Get a list of currently connected keyboards.
*
* \param count a pointer filled in with the number of keyboards returned
* \returns a 0 terminated array of keyboards instance IDs which should be
* freed with SDL_free(), or NULL on error; call SDL_GetError() for
* more details.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_HasKeyboard
*/
extern DECLSPEC SDL_KeyboardID *SDLCALL SDL_GetKeyboards(int *count);
/**
* Query the window which currently has keyboard focus.
*