views:

49

answers:

1

Is there any way to make the program sleep until an event occurs, but to not take it off the queue?

Similarly to http://www.pygame.org/docs/ref/event.html#pygame.event.wait

Or will I need to use pygame.event.wait, and then put that event back onto the queue?

Just to clarify, I do not need to know what that event is when it occurs, just that an event has occured.

+1  A: 

You will need to do what you suggest and post it back onto the queue. If the ordering is important (which it often is), then just keep your own queue of already retrieved events, and whenever you want to start processing events normally, just handle your own list first before draining pygame's queue.

I'm at a loss as to why you would want to know an event came in but not to handle it, however.

Kylotan
I don't anymore actually. My original plan was to make it sleep at the end of the loop until an event came up, and then continue from the start of the loop where the event processing is.. Then I realized I can make it sleep *before* the event processing. Thanks though
Jeffrey Aylesworth