ui: add shortcuts

This commit is contained in:
rr-
2018-11-05 21:04:39 +01:00
parent b66b3fca18
commit a265dc6d9d
4 changed files with 80 additions and 19 deletions
+10 -2
View File
@@ -26,11 +26,15 @@ class RosterView(urwid.Filler):
buttons.append(
MenuButton(
label="Create a new character", on_press=self.on_new_game_press
label="Create a new character",
hint="F1",
on_press=self.on_new_game_press,
)
)
buttons.append(MenuButton(label="Exit", on_press=self.on_exit_press))
buttons.append(
MenuButton(label="Exit", hint="Esc", on_press=self.on_exit_press)
)
super().__init__(
urwid.Padding(
@@ -62,4 +66,8 @@ class RosterView(urwid.Filler):
self._emit("exit")
return True
if key == "f1":
self._emit("new_game")
return True
return False