def peek(self, event): if pygame.event.peek(): for event in pygame.event.get(): #print("EVENT: " + str(event)) if event == pygame.QUIT: self.fireEvent(guiquit("close")) if event.type == pygame.KEYUP: if event.key == pygame.K_q: self.fireEvent(guiquit("key")) elif event.type == pygame.VIDEORESIZE: self.fireEvent(guiresize(event.w, event.h), "gui") elif event.type in (pygame.MOUSEBUTTONDOWN, pygame.MOUSEBUTTONUP, pygame.MOUSEMOTION): self.fireEvent(mouseevent(event), "gui") elif event.type in (pygame.JOYAXISMOTION, pygame.JOYHATMOTION, pygame.JOYBUTTONDOWN, pygame.JOYBUTTONUP, pygame.JOYBALLMOTION): self.fireEvent(joystickchange(event))
def buttonevent(self, event): if event.origin == "btnQuit": self.fireEvent(guiquit('btnQuit'))