[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] confusing documentation
Ivo Danihelka wrote:
Hi,
Pygame documentation suggests to call
pygame.event.get([KEYDOWN,KEYUP]) to get all
the keyboard events.
This is not always the right way, because the other events will remain
in the queue. SDL queue could contain max 128 unprocessed events,
additional events will be ignored.
The right way is to get all events by
pygame.event.get() or some other way.
Couldn't you call pygame.event.get([KEYDOWN,KEYUP]) to get just the
types of events you care about, and then -- what is it --
pygame.event.clear() [?] to flush out the unwanted ones? This would
prevent an overflow and save you from having to deal with every event.
Kris