primitivus (chat): added "GOTO_BOTTOM" ("G") shortcut to scroll down to last message in history

This commit is contained in:
Goffi 2017-07-14 08:34:10 +02:00
commit 50ff24cc64
2 changed files with 3 additions and 0 deletions

View file

@ -312,6 +312,8 @@ class Chat(PrimitivusWidget, quick_chat.QuickChat):
elif self.show_title == 2:
self.chat_widget.header = None
self._invalidate()
elif key == a_key['GOTO_BOTTOM']: # user wants to focus last message
self.mess_widgets.focus_position = len(self.mess_walker) - 1
return super(Chat, self).keypress(size, key)

View file

@ -55,6 +55,7 @@ action_key_map.update(
("chat_panel", "TIMESTAMP_HIDE"): "meta t",
("chat_panel", "SHORT_NICKNAME"): "meta n",
("chat_panel", "SUBJECT_SWITCH"): "meta s",
("chat_panel", "GOTO_BOTTOM"): "G",
#card game
("card_game", "CARD_SELECT"): ' ',