I'm trying to make a GUI library in C++ with SDL and I'm currently making buttons. They have three visual states. Idle (not pressed or hovered). Hovered (hovered but not pressed). Pressed (pressed). The thing is that when I try to use event.button.state == SDL_RELEASED, it returns true when I'm holding the mouse button (not released yet) and moving it. It also returns true when I release like normal. Do you guys have any idea how to solve this? Here's a block of my code: