From 57ddd8e95e5d8ff8ad0473e84e58094045e57d6a Mon Sep 17 00:00:00 2001 From: Martin Tournoij Date: Fri, 5 Jun 2015 14:24:43 +0200 Subject: [PATCH] Always handle the key, even if it's bound. This fixes #716, which sufficiently annoyed me to make this quick fix. It's not a great fix, but it's not worse than what we had already, and the current behaviour is very surprising IMHO. --- qutebrowser/keyinput/basekeyparser.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/qutebrowser/keyinput/basekeyparser.py b/qutebrowser/keyinput/basekeyparser.py index b52a39824..ce9719f31 100644 --- a/qutebrowser/keyinput/basekeyparser.py +++ b/qutebrowser/keyinput/basekeyparser.py @@ -162,12 +162,6 @@ class BaseKeyParser(QObject): key = e.key() self._debug_log("Got key: 0x{:x} / text: '{}'".format(key, txt)) - if key == Qt.Key_Escape: - self._debug_log("Escape pressed, discarding '{}'.".format( - self._keystring)) - self._keystring = '' - return self.Match.none - if len(txt) == 1: category = unicodedata.category(txt) is_control_char = (category == 'Cc') @@ -303,6 +297,15 @@ class BaseKeyParser(QObject): True if the event was handled, False otherwise. """ handled = self._handle_special_key(e) + + # Special case for . See: + # https://github.com/The-Compiler/qutebrowser/issues/716 + if e.key() == Qt.Key_Escape: + self._debug_log("Escape pressed, discarding '{}'.".format( + self._keystring)) + self._keystring = '' + self.keystring_updated.emit(self._keystring) + if handled or not self._supports_chains: return handled match = self._handle_single_key(e)