From b4d232badd7394875b78f61d31450fdeaee8d33b Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 28 Feb 2018 11:15:44 +0100 Subject: [PATCH] Simplify KeyInfo.text() --- qutebrowser/keyinput/keyutils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qutebrowser/keyinput/keyutils.py b/qutebrowser/keyinput/keyutils.py index 5280c8a9b..7f0e669a6 100644 --- a/qutebrowser/keyinput/keyutils.py +++ b/qutebrowser/keyinput/keyutils.py @@ -252,13 +252,13 @@ class KeyInfo: def text(self): """Get the text which would be displayed when pressing this key.""" - text = QKeySequence(self.key).toString() if self.key == Qt.Key_Space: return ' ' - elif len(text) > 1: - # Special key? + elif self.key > 0xff: + # Unprintable keys return '' + text = QKeySequence(self.key).toString() if not self.modifiers & Qt.ShiftModifier: text = text.lower() return text