def get_key(self):
c = self.stdscr.getch()
if c == curses.KEY_RESIZE:
self.resize()
return True
# 127 and 27 are to make sure the Backspace/ESC keys work properly
if 0 < c < 256 and c != 127 and c != 27:
c = chr(c)
try:
loop = self.keys[c]()
except KeyError:
if self.edit is True:
self.insert_char(c)
loop = True
return loop
评论列表
文章目录