Added SDL_EVENT_FINGER_CANCELED

Fixes https://github.com/libsdl-org/SDL/issues/10528
This commit is contained in:
Sam Lantinga committed 2024-12-30 19:13:02 -08:00
1 parent 8704ab8422
commit d4d5faedab
19 files changed
+90 -40

No files matched your search

+7 -3
View File
@@ -32,7 +32,7 @@
#define ACTION_DOWN 0
#define ACTION_UP 1
#define ACTION_MOVE 2
// #define ACTION_CANCEL 3
#define ACTION_CANCEL 3
// #define ACTION_OUTSIDE 4
#define ACTION_POINTER_DOWN 5
#define ACTION_POINTER_UP 6
@@ -72,7 +72,7 @@ void Android_OnTouch(SDL_Window *window, int touch_device_id_in, int pointer_fin
switch (action) {
case ACTION_DOWN:
case ACTION_POINTER_DOWN:
SDL_SendTouch(0, touchDeviceId, fingerId, window, true, x, y, p);
SDL_SendTouch(0, touchDeviceId, fingerId, window, SDL_EVENT_FINGER_DOWN, x, y, p);
break;
case ACTION_MOVE:
@@ -81,7 +81,11 @@ void Android_OnTouch(SDL_Window *window, int touch_device_id_in, int pointer_fin
case ACTION_UP:
case ACTION_POINTER_UP:
SDL_SendTouch(0, touchDeviceId, fingerId, window, false, x, y, p);
SDL_SendTouch(0, touchDeviceId, fingerId, window, SDL_EVENT_FINGER_UP, x, y, p);
break;
case ACTION_CANCEL:
SDL_SendTouch(0, touchDeviceId, fingerId, window, SDL_EVENT_FINGER_CANCELED, x, y, p);
break;
default: