def Refresh(self):
self.ResetKeys()
events = pygame.event.get()
for event in events:
if(event.type == pygame.KEYDOWN):
self.CheckInputCache(event.key)
self.pressed[event.key] = True
self.keyDown[event.key] = True
self.instantKey = event.key
elif(event.type == pygame.KEYUP):
self.pressed[event.key] = False
self.keyUp[event.key] = True
elif(event.type == pygame.MOUSEBUTTONDOWN):
self.pressed[self.mouseButtons[event.button-1]] = True
self.btnDown[self.mouseButtons[event.button-1]] = True
elif(event.type == pygame.MOUSEBUTTONUP):
self.pressed[self.mouseButtons[event.button-1]] = False
self.btnUp[self.mouseButtons[event.button-1]] = True
评论列表
文章目录