summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/ext/keybinding_parser.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/ranger/ext/keybinding_parser.py b/ranger/ext/keybinding_parser.py
index 015d173f..e044d80d 100644
--- a/ranger/ext/keybinding_parser.py
+++ b/ranger/ext/keybinding_parser.py
@@ -66,10 +66,13 @@ DIRKEY = 9001
 ANYKEY = 9002
 PASSIVE_ACTION = 9003
 
-special_keys = {
+very_special_keys = {
 	'dir': DIRKEY,
 	'any': ANYKEY,
 	'bg': PASSIVE_ACTION,
+}
+
+special_keys = {
 	'bs': curses.KEY_BACKSPACE,
 	'backspace': curses.KEY_BACKSPACE,
 	'backspace2': curses.ascii.DEL,
@@ -92,11 +95,16 @@ special_keys = {
 	's-tab': curses.KEY_BTAB,
 }
 
-for char in ascii_lowercase:
-	special_keys['c-' + char] = ord(char) - 96
+for key, val in special_keys.items():
+	special_keys['a-' + key] = (27, val)
 
-for char in (ascii_lowercase + '0123456789'):
+for char in ascii_lowercase + '0123456789':
 	special_keys['a-' + char] = (27, ord(char))
 
+for char in ascii_lowercase:
+	special_keys['c-' + char] = ord(char) - 96
+
 for n in range(64):
 	special_keys['f' + str(n)] = curses.KEY_F0 + n
+
+special_keys.update(very_special_keys)