Python pygame 模块,K_F5 实例源码

我们从Python开源项目中,提取了以下3个代码示例,用于说明如何使用pygame.K_F5

项目:tensorflow_dqn_supermario    作者:JSDanielPark    | 项目源码 | 文件源码
def toggle_show_fps(self, key):
        if key == pg.K_F5:
            self.show_fps = not self.show_fps
            if not self.show_fps:
                pg.display.set_caption(self.caption)
项目:planet-hopper    作者:reddit-pygame    | 项目源码 | 文件源码
def toggle_show_fps(self, key):
        """Press f5 to turn on/off displaying the framerate in the caption."""
        if key == pg.K_F5:
            self.show_fps = not self.show_fps
            if not self.show_fps:
                pg.display.set_caption(self.caption)
项目:Buffe    作者:bentzinir    | 项目源码 | 文件源码
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)