Really fix keyevent_to_string.
This commit is contained in:
parent
27117246b7
commit
1960cfe114
@ -506,10 +506,10 @@ class KeyEventToStringTests(unittest.TestCase):
|
||||
Qt.MetaModifier | Qt.ShiftModifier))
|
||||
if sys.platform == 'darwin':
|
||||
self.assertEqual(utils.keyevent_to_string(evt),
|
||||
'Ctrl+Alt+Shift+A')
|
||||
'Ctrl+Alt+Shift+A')
|
||||
else:
|
||||
self.assertEqual(utils.keyevent_to_string(evt),
|
||||
'Ctrl+Alt+Meta+Shift+A')
|
||||
'Ctrl+Alt+Meta+Shift+A')
|
||||
|
||||
|
||||
class NormalizeTests(unittest.TestCase):
|
||||
|
@ -442,7 +442,7 @@ def keyevent_to_string(e):
|
||||
mod = e.modifiers()
|
||||
parts = []
|
||||
for (mask, s) in modmask2str.items():
|
||||
if mod & mask:
|
||||
if mod & mask and s not in parts:
|
||||
parts.append(s)
|
||||
parts.append(key_to_string(e.key()))
|
||||
return '+'.join(parts)
|
||||
|
Loading…
Reference in New Issue
Block a user