diff options
author | Patrick Totzke <patricktotzke@gmail.com> | 2011-10-10 14:47:55 +0100 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2011-10-10 14:47:55 +0100 |
commit | 2e59e70c1e34fa094ea483bb53f1bd5cdda4776a (patch) | |
tree | a3a060bec12daa08f7e134d5755585faca32b34c /alot | |
parent | 121a9bf68a19d182e3f0f4df6c01e9e2af86e5de (diff) |
correctly handle select keypress
enter sends 'select' keypress, which should be used
for mappings
Diffstat (limited to 'alot')
-rw-r--r-- | alot/defaults/alot.rc | 8 | ||||
-rw-r--r-- | alot/ui.py | 23 |
2 files changed, 14 insertions, 17 deletions
diff --git a/alot/defaults/alot.rc b/alot/defaults/alot.rc index cae15711..63bf6ad9 100644 --- a/alot/defaults/alot.rc +++ b/alot/defaults/alot.rc @@ -87,14 +87,14 @@ colon = prompt [bufferlist-maps] x = closefocussed -enter = openfocussed +select = openfocussed [search-maps] a = toggletag inbox & = toggletag killed l = retagprompt O = refineprompt -enter = openthread +select = openthread | = refineprompt [envelope-maps] @@ -104,10 +104,9 @@ s = 'refine Subject' t = 'refine To' b = 'refine Bcc' c = 'refine Cc' -enter = reedit +select = reedit [taglist-maps] -enter = select [thread-maps] C = fold --all @@ -121,7 +120,6 @@ f = forward p = print s = save r = reply -enter = select | = 'prompt pipeto ' [command-aliases] @@ -50,18 +50,17 @@ class InputWrap(urwid.WidgetWrap): else: return False - def keypress(self, size, key, interpret=True): + def keypress(self, size, key): self.ui.logger.debug('got key: \'%s\'' % key) - if interpret: - mode = self.ui.mode - if self.select_cancel_only: - mode = 'global' - cmdline = config.get_mapping(mode, key) - if cmdline: - cmd = interpret_commandline(cmdline, self.ui.mode) - if self.allowed_command(cmd): - self.ui.apply_command(cmd) - return None + mode = self.ui.mode + if self.select_cancel_only: + mode = 'global' + cmdline = config.get_mapping(mode, key) + if cmdline: + cmd = interpret_commandline(cmdline, mode) + if self.allowed_command(cmd): + self.ui.apply_command(cmd) + return None self.ui.logger.debug('relaying key: %s' % key) return self._w.keypress(size, key) @@ -101,7 +100,7 @@ class UI(object): self.logger.debug('unhandeled input: %s' % key) def keypress(self, key): - self.inputwrap.keypress((150, 20), key, interpret=False) + self.inputwrap.keypress((150, 20), key) def show_as_root_until_keypress(self, w, key): def oe(): |