Fix keypress handling on board view

Change-Id: Ic91bb91871091436e41802cd0a9e606cd8b90969
This commit is contained in:
James E. Blair 2017-02-24 22:36:25 -05:00
parent 1da12089a5
commit 47cf3f610d
1 changed files with 16 additions and 1 deletions

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(