def eventIterator(): while True: yield eventmodule.wait() while True: event = eventmodule.poll() if event.type == NOEVENT: break else: yield event
def test_poll(self): # __doc__ (as of 2008-08-02) for pygame.fastevent.poll: # pygame.fastevent.poll() -> Event # get an available event # # Returns next event on queue. If there is no event waiting on the # queue, this will return an event with type NOEVENT. self.assertEqual(fastevent.poll().type, pygame.NOEVENT, race_condition_notification)
def test_poll(self): # __doc__ (as of 2008-08-02) for pygame.fastevent.poll: # pygame.fastevent.poll() -> Event # get an available event # # Returns next event on queue. If there is no event waiting on the # queue, this will return an event with type NOEVENT. self.assertEquals ( fastevent.poll().type, pygame.NOEVENT, race_condition_notification )
def eventIterator(self): while True: # print "***" # --- # self._tickClock() # 20100908 got rid of this, move to looping call #20070820 if not self._paused: #20070820 self.updateObjects() # move # --- if UsingFastEvent: #print "Yielding" yield eventmodule.wait() # seems to hang otherwise #print "Done Yielding" while True: event = eventmodule.poll() if event.type == NOEVENT: break else: yield event # --- # print "***---" """ # 20100908 trying looping call instead of doing it here