diff --git a/include/SDL_keyboard.h b/include/SDL_keyboard.h index 9b44df322..ece05b9bf 100644 --- a/include/SDL_keyboard.h +++ b/include/SDL_keyboard.h @@ -66,13 +66,13 @@ extern DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void); * * \b Example: * \code - * Uint8 *state = SDL_GetKeyboardState(NULL); + * const Uint8 *state = SDL_GetKeyboardState(NULL); * if ( state[SDL_SCANCODE_RETURN] ) { * printf(" is pressed.\n"); * } * \endcode */ -extern DECLSPEC Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys); +extern DECLSPEC const Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys); /** * \brief Get the current key modifier state for the keyboard. diff --git a/src/events/SDL_keyboard.c b/src/events/SDL_keyboard.c index 680091f42..468c3d109 100644 --- a/src/events/SDL_keyboard.c +++ b/src/events/SDL_keyboard.c @@ -829,7 +829,7 @@ SDL_KeyboardQuit(void) { } -Uint8 * +const Uint8 * SDL_GetKeyboardState(int *numkeys) { SDL_Keyboard *keyboard = &SDL_keyboard;