[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] event queue full



Jack Nutting wrote:
    for event in pygame.event.get([KEYDOWN,KEYUP,QUIT]):
I have a hunch this is still your problem somehow. Change the line to this,

for event in pygame.event.get():

By getting all events you will really make sure the queue is empties each time you loop through the events. It looked like all the other event types should be disabled anyways.

In hindsight I've found providing a list of event types to pygame.event.get() is fairly dangerous. It only removes the events you are interested, and anything else can get piled up on the queue. SDL's event queue is only 256 elements, which is plenty for one frame but fills up fast if left alone.