curses_reporter.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:copycat 作者: LSaldyt 项目源码 文件源码
def do_keyboard_shortcuts(self):
        w = self.temperatureWindow  # just a random window
        ordch = w.getch()
        if ordch in [ord('P'), ord('p')]:
            w.addstr(0, 0, 'PAUSE', curses.A_STANDOUT)
            w.refresh()
            ordch = None
            while ordch not in [ord('P'), ord('p'), 27, ord('Q'), ord('q')]:
                time.sleep(0.1)
                ordch = w.getch()
            self.fpsTicks = 0
            self.fpsSince = time.time()
            w.erase()
            w.border()
            w.refresh()
        if ordch in [27, ord('Q'), ord('q')]:
            raise KeyboardInterrupt()
        if ordch in [ord('F')]:
            self.fpsGoal = (self.fpsGoal or self.fpsMeasured) * 1.25
        if ordch in [ord('f')]:
            self.fpsGoal = (self.fpsGoal or self.fpsMeasured) * 0.8
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号