From 56cbdaacb6b674d0f8b0db7430b2942331358194 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Sun, 20 Mar 2011 02:42:29 +0100 Subject: [PATCH] Alt+x where x is a number --- src/core.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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)