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 committed 2024-09-09 14:00:19 -07:00
1 parent 7d1bbae6b2
commit 6fc6e3dc7e
89 files changed
+935 -956

No files matched your search

+2 -2
View File
@@ -370,12 +370,12 @@ static SDL_Scancode TranslateKeycode(int keycode)
void Android_OnKeyDown(int keycode)
{
SDL_SendKeyboardKey(0, SDL_DEFAULT_KEYBOARD_ID, keycode, TranslateKeycode(keycode), SDL_PRESSED);
SDL_SendKeyboardKey(0, SDL_DEFAULT_KEYBOARD_ID, keycode, TranslateKeycode(keycode), true);
}
void Android_OnKeyUp(int keycode)
{
SDL_SendKeyboardKey(0, SDL_DEFAULT_KEYBOARD_ID, keycode, TranslateKeycode(keycode), SDL_RELEASED);
SDL_SendKeyboardKey(0, SDL_DEFAULT_KEYBOARD_ID, keycode, TranslateKeycode(keycode), false);
}
bool Android_HasScreenKeyboardSupport(SDL_VideoDevice *_this)
+2 -2
View File
@@ -221,7 +221,7 @@ void Android_OnMouse(SDL_Window *window, int state, int action, float x, float y
button = TranslateButton(changes);
last_state = state;
SDL_SendMouseMotion(0, window, SDL_DEFAULT_MOUSE_ID, relative, x, y);
SDL_SendMouseButton(0, window, SDL_DEFAULT_MOUSE_ID, SDL_PRESSED, button);
SDL_SendMouseButton(0, window, SDL_DEFAULT_MOUSE_ID, button, true);
break;
case ACTION_UP:
@@ -229,7 +229,7 @@ void Android_OnMouse(SDL_Window *window, int state, int action, float x, float y
button = TranslateButton(changes);
last_state = state;
SDL_SendMouseMotion(0, window, SDL_DEFAULT_MOUSE_ID, relative, x, y);
SDL_SendMouseButton(0, window, SDL_DEFAULT_MOUSE_ID, SDL_RELEASED, button);
SDL_SendMouseButton(0, window, SDL_DEFAULT_MOUSE_ID, button, false);
break;
case ACTION_MOVE: