Browse Source

Fix keypress handling on board view

Change-Id: Ic91bb91871091436e41802cd0a9e606cd8b90969
changes/54/438654/2
James E. Blair 4 years ago
parent
commit
47cf3f610d
1 changed files with 16 additions and 1 deletions
  1. +16
    -1
      boartty/view/board.py

+ 16
- 1
boartty/view/board.py View File

@ -37,7 +37,7 @@ class BoardView(urwid.WidgetWrap, mywid.Searchable):
def getCommands(self):
return [
(keymap.REFRESH,
"Sync subscribed boards"),
"Sync current board"),
(keymap.INTERACTIVE_SEARCH,
"Interactive search"),
]
@ -117,6 +117,21 @@ class BoardView(urwid.WidgetWrap, mywid.Searchable):
self.log.debug("Open story %s", story_key)
self.app.openStory(story_key)
def keypress(self, size, key):
if self.searchKeypress(size, key):
return None
if not self.app.input_buffer:
key = super(BoardView, self).keypress(size, key)
keys = self.app.input_buffer + [key]
commands = self.app.config.keymap.getCommands(keys)
ret = self.handleCommands(commands)
if ret is True:
if keymap.FURTHER_INPUT not in commands:
self.app.clearInputBuffer()
return None
return key
def handleCommands(self, commands):
if keymap.REFRESH in commands:
self.app.sync.submitTask(


Loading…
Cancel
Save