Use SDL_bool where appropriate in SDL events

This involved changing button state from Uint8 to SDL_bool, and made SDL_PRESSED and SDL_RELEASED unnecessary.

Fixes https://github.com/libsdl-org/SDL/issues/10069
This commit is contained in:
Sam Lantinga 2024-09-09 09:18:02 -07:00
parent 7d1bbae6b2
commit 6fc6e3dc7e
89 changed files with 935 additions and 956 deletions

View file

@ -28,7 +28,7 @@ typedef bool (*SDL_IME_Init_t)(void);
typedef void (*SDL_IME_Quit_t)(void);
typedef void (*SDL_IME_SetFocus_t)(bool);
typedef void (*SDL_IME_Reset_t)(void);
typedef bool (*SDL_IME_ProcessKeyEvent_t)(Uint32, Uint32, Uint8 state);
typedef bool (*SDL_IME_ProcessKeyEvent_t)(Uint32, Uint32, bool down);
typedef void (*SDL_IME_UpdateTextInputArea_t)(SDL_Window *window);
typedef void (*SDL_IME_PumpEvents_t)(void);
@ -126,10 +126,10 @@ void SDL_IME_Reset(void)
}
}
bool SDL_IME_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state)
bool SDL_IME_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, bool down)
{
if (SDL_IME_ProcessKeyEvent_Real) {
return SDL_IME_ProcessKeyEvent_Real(keysym, keycode, state);
return SDL_IME_ProcessKeyEvent_Real(keysym, keycode, down);
}
return false;