From f1b20f6dc478933efa361eb6ce0c9f5af2891357 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 26 Feb 2018 20:02:43 +0100 Subject: [PATCH] Fix forward_unbound_keys test --- qutebrowser/keyinput/keyutils.py | 4 ++++ tests/end2end/features/keyinput.feature | 9 ++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/qutebrowser/keyinput/keyutils.py b/qutebrowser/keyinput/keyutils.py index 53d9fe2c3..f0832db15 100644 --- a/qutebrowser/keyinput/keyutils.py +++ b/qutebrowser/keyinput/keyutils.py @@ -263,6 +263,10 @@ class KeyInfo: def text(self): """Get the text which would be displayed when pressing this key.""" text = QKeySequence(self.key).toString() + if len(text) > 1: + # Special key? + return '' + if not self.modifiers & Qt.ShiftModifier: text = text.lower() return text diff --git a/tests/end2end/features/keyinput.feature b/tests/end2end/features/keyinput.feature index 5628a5796..b0cd765de 100644 --- a/tests/end2end/features/keyinput.feature +++ b/tests/end2end/features/keyinput.feature @@ -33,14 +33,13 @@ Feature: Keyboard input Scenario: Forwarding special keys When I open data/keyinput/log.html And I set input.forward_unbound_keys to auto - And I press the key "x" - And I press the key "" + And I press the keys "," # Then the javascript message "key press: 112" should be logged And the javascript message "key release: 112" should be logged - # x - And the javascript message "key press: 88" should not be logged - And the javascript message "key release: 88" should not be logged + # , + And the javascript message "key press: 188" should not be logged + And the javascript message "key release: 188" should not be logged Scenario: Forwarding no keys When I open data/keyinput/log.html