Pass the OS event timestamp for keyboard, mouse, and touch events where possible

Currently implemented for Windows and Apple platforms
This commit is contained in:
Sam Lantinga
2022-12-02 09:03:13 -08:00
parent 1f4cc733a1
commit 0a3262e819
62 changed files with 441 additions and 313 deletions

View File

@@ -204,7 +204,7 @@ int Android_OnPadDown(int device_id, int keycode)
if (item && item->joystick) {
SDL_PrivateJoystickButton(item->joystick, button, SDL_PRESSED);
} else {
SDL_SendKeyboardKey(SDL_PRESSED, button_to_scancode(button));
SDL_SendKeyboardKey(0, SDL_PRESSED, button_to_scancode(button));
}
SDL_UnlockJoysticks();
return 0;
@@ -223,7 +223,7 @@ int Android_OnPadUp(int device_id, int keycode)
if (item && item->joystick) {
SDL_PrivateJoystickButton(item->joystick, button, SDL_RELEASED);
} else {
SDL_SendKeyboardKey(SDL_RELEASED, button_to_scancode(button));
SDL_SendKeyboardKey(0, SDL_RELEASED, button_to_scancode(button));
}
SDL_UnlockJoysticks();
return 0;