summaryrefslogtreecommitdiff
path: root/qutebrowser/keyinput/basekeyparser.py
diff options
context:
space:
mode:
authorFlorian Bruhin <git@the-compiler.org>2018-03-02 14:16:40 +0100
committerFlorian Bruhin <git@the-compiler.org>2018-03-04 20:21:58 +0100
commitb3834835edb32188bb53dcaab502fef689e6b07d (patch)
tree267d9aec71129e44dcbed40780b05a3b7dfc73aa /qutebrowser/keyinput/basekeyparser.py
parente306e2dadb3d2d38d7f9b9c794a59d6eb163ef81 (diff)
downloadqutebrowser-b3834835edb32188bb53dcaab502fef689e6b07d.tar.gz
qutebrowser-b3834835edb32188bb53dcaab502fef689e6b07d.zip
Bring back keyutils.is_modifier() and modifier handling
Turns out when we press yY, we get three events: Qt.Key_Y, Qt.NoModifier Qt.Key_Shift, Qt.ShiftModifier Qt.Key_Y, Qt.ShiftModifier If we don't ignore the second one, our keychain will be interrupted by the Shift keypress.
Diffstat (limited to 'qutebrowser/keyinput/basekeyparser.py')
-rw-r--r--qutebrowser/keyinput/basekeyparser.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/qutebrowser/keyinput/basekeyparser.py b/qutebrowser/keyinput/basekeyparser.py
index a8501ab4c..2c934617b 100644
--- a/qutebrowser/keyinput/basekeyparser.py
+++ b/qutebrowser/keyinput/basekeyparser.py
@@ -128,6 +128,10 @@ class BaseKeyParser(QObject):
txt = str(keyutils.KeyInfo.from_event(e))
self._debug_log("Got key: 0x{:x} / text: '{}'".format(key, txt))
+ if keyutils.is_modifier_key(key):
+ self._debug_log("Ignoring, only modifier")
+ return QKeySequence.NoMatch
+
if (txt.isdigit() and self._supports_count and not
(not self._count and txt == '0')):
assert len(txt) == 1, txt