Can I ask: there is any way to detect the mouse hold event?

I believe SDL only handles mouse down and mouse up.

Theres 2 things you could do.
When pressed set a bool to true and when released set it to false. While its true you know its held down.


Store previous and current state for mouse clicks to determine if mouse if pressed, held or released.

1 Like

You can also use SDL_GetMouseState() to see which mouse buttons are currently down. There’s an SDL_MOUSEMOTION event, too, if that helps what you’re trying to do.

1 Like