def _watchdog_key(self): """ 接受按键, 存入queue """ while True: k = getch.getch() self.key_queue.put(k)
def _controller(self): """ 接受按键, 存入queue """ while not self.quit: k = getch.getch() self.queue.put(k) if k == 'o' or k == 'q' or k == 'h': break
def _controller(self): """ 接受按键, 存入queue """ while not self.quit: k = getch.getch() self.queue.put(k) if k == self.keys['QUIT']: break
def _controller(self): """ 接受按键, 存入queue """ while not self.quit: k = getch.getch() logger.info(k) self.queue.put(k) if k == 'q': break
def _controller(self): """ 接受按键, 存入queue """ while not self.quit: k = getch.getch() self.queue.put(k) # 此处退出时需要做一下判断, 不然会引发切换线程无法读取的bug if k == 'o' or k == 'q' or k == 'h' or k == 't': break
def _controller(self): """ 接受按键, 存入queue """ while not self.quit: k = getch.getch() self.queue.put(k) # 此处退出时需要做一下判断, 不然会引发切换线程无法读取的bug # TODO: 按键映射 if k == 'o' or k == 'q' or k == 'h' or k == 't': break
def _controller(self): """ 接受按键, 存入queue """ try: while not self.quit: k = getch.getch() self.queue.put(k) # 此处退出时需要做一下判断, 不然会引发切换线程无法读取的bug # TODO: 按键映射 if k == 'o' or k == 'q' or k == 'h' or k == 't': break except: pass
def _controller(self): """ 接受按键, 存入queue """ k = getch.getch() self.queue.put(k)
def _watchdog_key(self): # why not use the instant one while True: k = getch.getch() self.key_queue.put(k)