From 261bb85791d032267f4cad0043c6814d6212a713 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 3 Jul 2014 07:52:58 +0200 Subject: [PATCH] Handle escape key correctly --- qutebrowser/utils/misc.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/qutebrowser/utils/misc.py b/qutebrowser/utils/misc.py index cb759008a..14e720b87 100644 --- a/qutebrowser/utils/misc.py +++ b/qutebrowser/utils/misc.py @@ -407,7 +407,15 @@ def key_to_string(key): try: return special_names[key] except KeyError: - return QKeySequence(key).toString().replace("Backtab", "Tab") + name = QKeySequence(key).toString().replace("Backtab", "Tab") + morphings = { + 'Backtab': 'Tab', + 'Esc': 'Escape', + } + if name in morphings: + return morphings[name] + else: + return name def keyevent_to_string(e):