Simplify KeyInfo.text()
This commit is contained in:
parent
2ca15d7667
commit
b4d232badd
@ -252,13 +252,13 @@ class KeyInfo:
|
|||||||
|
|
||||||
def text(self):
|
def text(self):
|
||||||
"""Get the text which would be displayed when pressing this key."""
|
"""Get the text which would be displayed when pressing this key."""
|
||||||
text = QKeySequence(self.key).toString()
|
|
||||||
if self.key == Qt.Key_Space:
|
if self.key == Qt.Key_Space:
|
||||||
return ' '
|
return ' '
|
||||||
elif len(text) > 1:
|
elif self.key > 0xff:
|
||||||
# Special key?
|
# Unprintable keys
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
text = QKeySequence(self.key).toString()
|
||||||
if not self.modifiers & Qt.ShiftModifier:
|
if not self.modifiers & Qt.ShiftModifier:
|
||||||
text = text.lower()
|
text = text.lower()
|
||||||
return text
|
return text
|
||||||
|
Loading…
Reference in New Issue
Block a user