Fix handling of </> keys
This commit is contained in:
parent
910bbc8521
commit
0967b6abd2
@ -184,6 +184,8 @@ def _parse_special_key(keystr):
|
||||
('windows', 'meta'),
|
||||
('mod1', 'alt'),
|
||||
('mod4', 'meta'),
|
||||
('less', '<'),
|
||||
('greater', '>'),
|
||||
)
|
||||
for (orig, repl) in replacements:
|
||||
keystr = keystr.replace(orig, repl)
|
||||
|
@ -355,6 +355,20 @@ class TestKeySequence:
|
||||
('<Control-x><Meta-y>',
|
||||
keyutils.KeySequence(Qt.ControlModifier | Qt.Key_X,
|
||||
Qt.MetaModifier | Qt.Key_Y)),
|
||||
|
||||
('>', keyutils.KeySequence(Qt.Key_Greater)),
|
||||
('<', keyutils.KeySequence(Qt.Key_Less)),
|
||||
('a>', keyutils.KeySequence(Qt.Key_A, Qt.Key_Greater)),
|
||||
('a<', keyutils.KeySequence(Qt.Key_A, Qt.Key_Less)),
|
||||
('>a', keyutils.KeySequence(Qt.Key_Greater, Qt.Key_A)),
|
||||
('<a', keyutils.KeySequence(Qt.Key_Less, Qt.Key_A)),
|
||||
('<alt+greater>',
|
||||
keyutils.KeySequence(Qt.Key_Greater | Qt.AltModifier)),
|
||||
('<alt+less>',
|
||||
keyutils.KeySequence(Qt.Key_Less | Qt.AltModifier)),
|
||||
|
||||
('<alt+<>', keyutils.KeyParseError),
|
||||
('<alt+>>', keyutils.KeyParseError),
|
||||
('<blub>', keyutils.KeyParseError),
|
||||
('\U00010000', keyutils.KeyParseError),
|
||||
])
|
||||
|
Loading…
Reference in New Issue
Block a user