Event question

I was wondering if anyone could help clear up a concern I have with events
in SDL.

When I call SDL_PumpEvents, does this clear what is currently in the event
queue, or simply add to the list of events?

If I PollEvents (which automatically calls PumpEvents), can I still check
the status of any key?

The only reason I ask is because I’m fairly desperate about the fact that I
have ‘phantom’ events. I’m receiving key presses that appear to get stuck
in the queue under Windows.

Can anyone clear this up for me please?

Rob

If I PollEvents (which automatically calls PumpEvents), can I still check
the status of any key?

You can check key status if you keep them in another variable

see what I explain

SDL_Event ev;
int IsKeyPressed[256]

While(1) //main loop
{
While(SDL_PollEvents(&ev))
{
switch(ev.type)
{
case SDL_KEYDOWN:
IsKeyPressed[ev.key.keysym.sym] = 1;
case SDL_KEYUP:
IsKeyPressed[ev.key.keysymsym] = 0;
}
}
/then you can check you keys when tyou want in you main loop
if(IsAKeyPressed[SDLK_DOWN]==1)
//trulululu
if(IsAKeyPressed[SDLK_LEFT]==1)
//plof-plof
}