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))
|
Qt.MetaModifier | Qt.ShiftModifier))
|
||||||
if sys.platform == 'darwin':
|
if sys.platform == 'darwin':
|
||||||
self.assertEqual(utils.keyevent_to_string(evt),
|
self.assertEqual(utils.keyevent_to_string(evt),
|
||||||
'Ctrl+Alt+Shift+A')
|
'Ctrl+Alt+Shift+A')
|
||||||
else:
|
else:
|
||||||
self.assertEqual(utils.keyevent_to_string(evt),
|
self.assertEqual(utils.keyevent_to_string(evt),
|
||||||
'Ctrl+Alt+Meta+Shift+A')
|
'Ctrl+Alt+Meta+Shift+A')
|
||||||
|
|
||||||
|
|
||||||
class NormalizeTests(unittest.TestCase):
|
class NormalizeTests(unittest.TestCase):
|
||||||
|
@ -442,7 +442,7 @@ def keyevent_to_string(e):
|
|||||||
mod = e.modifiers()
|
mod = e.modifiers()
|
||||||
parts = []
|
parts = []
|
||||||
for (mask, s) in modmask2str.items():
|
for (mask, s) in modmask2str.items():
|
||||||
if mod & mask:
|
if mod & mask and s not in parts:
|
||||||
parts.append(s)
|
parts.append(s)
|
||||||
parts.append(key_to_string(e.key()))
|
parts.append(key_to_string(e.key()))
|
||||||
return '+'.join(parts)
|
return '+'.join(parts)
|
||||||
|
Loading…
Reference in New Issue
Block a user