Trying to remove an event from the event queue


#1

Hello, I’m trying to remove an event by using SDL_PeepEvents, SDL_MOUSEBUTTONUP to be specific.
This is the code I’m using, but it does not seem to work.

bool has_left_click_event()
{
    SDL_PumpEvents();
    SDL_Event eve;
    int count = SDL_PeepEvents(&eve, 1, SDL_GETEVENT, SDL_MOUSEBUTTONUP, 0);
    SDL_Log("%i", count);
    if(count > 0) {
        if(eve.button.button == SDL_BUTTON_LEFT) {
            SDL_Log("sdfsdf"); // testing
            return true;
        }
    }
    return false;
}

and I don’t really understand the minType and the maxType paramters of SDL_PeepEvents
Thanks.