Really fix keyevent_to_string.

This commit is contained in:
Florian Bruhin 2014-09-26 07:31:59 +02:00
parent 27117246b7
commit 1960cfe114
2 changed files with 3 additions and 3 deletions

View File

@ -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):

View File

@ -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)