diff options
author | Florent Le Coz <louiz@louiz.org> | 2011-05-29 00:35:47 +0200 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2011-05-29 00:35:47 +0200 |
commit | 0db064fdf7831e6a74a0571b5fd544db53a41a16 (patch) | |
tree | 978f179af63404031a7a94ffcaf6d1df46e4224f /src/core.py | |
parent | 67881b977954c9cf330ceebc97cd400152b8c550 (diff) | |
parent | 8d3053bd93db2e976f49a3a32038712083d411a7 (diff) | |
download | poezio-0db064fdf7831e6a74a0571b5fd544db53a41a16.tar.gz poezio-0db064fdf7831e6a74a0571b5fd544db53a41a16.tar.bz2 poezio-0db064fdf7831e6a74a0571b5fd544db53a41a16.tar.xz poezio-0db064fdf7831e6a74a0571b5fd544db53a41a16.zip |
Merge, whatever
Diffstat (limited to 'src/core.py')
-rw-r--r-- | src/core.py | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/src/core.py b/src/core.py index f96a61a8..44c967ca 100644 --- a/src/core.py +++ b/src/core.py @@ -670,23 +670,31 @@ class Core(object): """ # curses.ungetch(0) # FIXME while self.running: - char = self.read_keyboard() + char_list = self.read_keyboard() # Special case for M-x where x is a number - if char.startswith('M-') and len(char) == 3: - try: - nb = int(char[2]) - except ValueError: - pass - else: - if self.current_tab().nb == nb: - self.go_to_previous_tab() + if len(char_list) == 1: + char = char_list[0] + if char.startswith('M-') and len(char) == 3: + try: + nb = int(char[2]) + except ValueError: + pass else: - self.command_win('%d' % nb) - # search for keyboard shortcut - if char in self.key_func: - self.key_func[char]() + if self.current_tab().nb == nb: + self.go_to_previous_tab() + else: + self.command_win('%d' % nb) + # search for keyboard shortcut + if char in self.key_func: + self.key_func[char]() + else: + res = self.do_command(char) + if res: + self.refresh_window() else: - self.do_command(char) + for char in char_list: + self.do_command(char) + self.refresh_window() self.doupdate() def current_tab(self): @@ -1419,9 +1427,7 @@ class Core(object): def do_command(self, key): if not key: return - res = self.current_tab().on_input(key) - if res: - self.refresh_window() + return self.current_tab().on_input(key) def on_roster_enter_key(self, roster_row): """ |