diff options
author | hut <hut@lavabit.com> | 2010-04-07 18:50:50 +0200 |
---|---|---|
committer | hut <hut@lavabit.com> | 2010-04-07 18:50:50 +0200 |
commit | eacd742bd40013d8868fc75a29a85a14f1ee1e81 (patch) | |
tree | c4606a28908530e19452f6e9af3eb215f6cb04f3 /ranger | |
parent | 894665269984ebf9f07bd9cae681ba2057715e25 (diff) | |
download | ranger-eacd742bd40013d8868fc75a29a85a14f1ee1e81.tar.gz |
container.keymap: support for Alt key
Diffstat (limited to 'ranger')
-rw-r--r-- | ranger/container/keymap.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ranger/container/keymap.py b/ranger/container/keymap.py index 41875cb2..dee54430 100644 --- a/ranger/container/keymap.py +++ b/ranger/container/keymap.py @@ -295,6 +295,7 @@ special_keys = { } for char in ascii_lowercase: special_keys['c-' + char] = ord(char) - 96 + special_keys['a-' + char] = (27, ord(char)) def translate_keys(obj): """ @@ -318,12 +319,16 @@ def translate_keys(obj): in_brackets = False string = ''.join(bracket_content).lower() try: - yield special_keys[string] + keys = special_keys[string] + for key in keys: + yield key except KeyError: yield ord('<') for c in bracket_content: yield ord(c) yield ord('>') + except TypeError: + yield keys # it was no tuple, just an int else: bracket_content.append(char) else: |