summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/container/keymap.py7
-rw-r--r--test/tc_newkeys.py2
2 files changed, 8 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:
diff --git a/test/tc_newkeys.py b/test/tc_newkeys.py
index bcf08e5f..bbfc74e9 100644
--- a/test/tc_newkeys.py
+++ b/test/tc_newkeys.py
@@ -136,6 +136,8 @@ class Test(PressTestCase):
 		test('<C-b>', 2)
 		for i in range(1, 26):
 			test('<C-' + chr(i+ord('a')-1) + '>', i)
+		test('<A-x>', 27, ord('x'))
+		test('<a-o>', 27, ord('o'))
 		test('k<a')
 		test('k<anz>')
 		test('k<a<nz>')
' href='#n163'>163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269