我们从Python开源项目中,提取了以下1个代码示例,用于说明如何使用pygame.KMOD_LCTRL。
def _event_handler(self): for event in pygame.event.get(): if event.type == pygame.QUIT: self._running = False elif event.type == pygame.KEYDOWN: if event.key == pygame.K_q and pygame.key.get_mods() & pygame.KMOD_LCTRL: self._running = False elif event.key == pygame.K_F5: raise GameResetException() elif event.key == pygame.K_KP_PLUS: self._fps *= 2 elif event.key == pygame.K_KP_MINUS: self._fps = max(1,self._fps/2)