Handle internal SDL_EVENT_FINGER_CANCELED events.

This commit is contained in:
Sasha Szpakowski
2025-01-24 22:27:34 -04:00
parent 5b4ced266d
commit 38168d4857
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -364,7 +364,7 @@ Message *Event::convert(const SDL_Event &e)
if (e.type == SDL_EVENT_FINGER_DOWN)
txt = "touchpressed";
else if (e.type == SDL_EVENT_FINGER_UP)
else if (e.type == SDL_EVENT_FINGER_UP || e.type == SDL_EVENT_FINGER_CANCELED)
txt = "touchreleased";
else
txt = "touchmoved";
+1
View File
@@ -86,6 +86,7 @@ void Touch::onEvent(Uint32 eventtype, const TouchInfo &info)
break;
}
case SDL_EVENT_FINGER_UP:
case SDL_EVENT_FINGER_CANCELED:
touches.erase(std::remove_if(touches.begin(), touches.end(), compare), touches.end());
break;
default: