Skip to content

Commit

Permalink
Handle internal SDL_EVENT_FINGER_CANCELED events.
Browse files Browse the repository at this point in the history
  • Loading branch information
slime73 committed Jan 25, 2025
1 parent 5b4ced2 commit 38168d4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/modules/event/sdl/Event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
1 change: 1 addition & 0 deletions src/modules/touch/sdl/Touch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 38168d4

Please sign in to comment.