def keypress(self, size, key):
"""Handle all keyboard shortcuts for the market menu"""
if key in self.keypress_map:
# Open up the order dialog to buy sell this item
commodity = self.keypress_map[key]
self.pubpen.publish(self.order_info_event, commodity,
self.auxiliary_cols[self.price_col_idx].data_map[commodity],
self.location)
urwid.emit_signal(self, self.signals[1])
elif key in ('left', 'right'):
# Ignore keys that might move focus to a widget to the side
return
elif key in ('up', 'down', 'page up', 'page down'):
# First let the children handle the change in focus...
super().keypress(size, key) #pylint: disable=not-callable
# Then highlight the same entry in other columns
self._highlight_focused_line()
else:
super().keypress(size, key) #pylint: disable=not-callable
return key
评论列表
文章目录