diff options
author | Florent Le Coz <louiz@louiz.org> | 2011-03-20 02:42:29 +0100 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2011-03-20 02:42:29 +0100 |
commit | 56cbdaacb6b674d0f8b0db7430b2942331358194 (patch) | |
tree | 586e33590b9b5761da7967d352064f6116423c13 /src | |
parent | cba3adcced7f6fa0670ba5012bcd59974c05ea09 (diff) | |
download | poezio-56cbdaacb6b674d0f8b0db7430b2942331358194.tar.gz poezio-56cbdaacb6b674d0f8b0db7430b2942331358194.tar.bz2 poezio-56cbdaacb6b674d0f8b0db7430b2942331358194.tar.xz poezio-56cbdaacb6b674d0f8b0db7430b2942331358194.zip |
Alt+x where x is a number
Diffstat (limited to 'src')
-rw-r--r-- | src/core.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/core.py b/src/core.py index 803cbe38..49aaeeab 100644 --- a/src/core.py +++ b/src/core.py @@ -124,6 +124,7 @@ class Core(object): } self.key_func = { + "KEY_PPAGE": self.scroll_page_up, "KEY_NPAGE": self.scroll_page_down, "KEY_F(5)": self.rotate_rooms_left, @@ -604,8 +605,16 @@ class Core(object): # curses.ungetch(0) # FIXME while self.running: char = read_char(self.stdscr) + # Special case for M-x where x is a number + if char.startswith('M-') and len(char) == 3: + try: + nb = int(char[2]) + except: + pass + else: + self.command_win('%s' % nb) # search for keyboard shortcut - if char in list(self.key_func.keys()): + elif char in list(self.key_func.keys()): self.key_func[char]() else: self.do_command(char) |