def keypress(self, size, key):
keyl = key.lower()
if key == "enter":
app.remove_overlays()
self.callback(self.value(), *self.args)
elif keyl in ("q", "esc", "ctrl g", "ctrl c"):
app.remove_overlays()
elif keyl in ("down", "ctrl n", "n", "j"):
self.incr("down")
elif keyl in ("up", "ctrl p", "p", "k"):
self.incr("up")
else: # dont use super because we want to allow zeros in this box
urwid.Edit.keypress(self, (size[0],), key)
评论列表
文章目录