def keypress(self, size, key): if key == 'tab': self.switch_focus() return urwid.Frame.keypress(self, size, key)