Use OrderedDict for modmask2str
This commit is contained in:
parent
261bb85791
commit
734ee74e8a
@ -26,6 +26,7 @@ import shlex
|
|||||||
import os.path
|
import os.path
|
||||||
import urllib.request
|
import urllib.request
|
||||||
from urllib.parse import urljoin, urlencode
|
from urllib.parse import urljoin, urlencode
|
||||||
|
from collections import OrderedDict
|
||||||
from functools import reduce
|
from functools import reduce
|
||||||
|
|
||||||
import rfc6266
|
import rfc6266
|
||||||
@ -428,12 +429,12 @@ def keyevent_to_string(e):
|
|||||||
A name of the key (combination) as a string or
|
A name of the key (combination) as a string or
|
||||||
None if only modifiers are pressed..
|
None if only modifiers are pressed..
|
||||||
"""
|
"""
|
||||||
modmask2str = {
|
modmask2str = OrderedDict([
|
||||||
Qt.ControlModifier: 'Ctrl',
|
(Qt.ControlModifier, 'Ctrl'),
|
||||||
Qt.AltModifier: 'Alt',
|
(Qt.AltModifier, 'Alt'),
|
||||||
Qt.MetaModifier: 'Meta',
|
(Qt.MetaModifier, 'Meta'),
|
||||||
Qt.ShiftModifier: 'Shift'
|
(Qt.ShiftModifier, 'Shift'),
|
||||||
}
|
])
|
||||||
modifiers = (Qt.Key_Control, Qt.Key_Alt, Qt.Key_Shift, Qt.Key_Meta,
|
modifiers = (Qt.Key_Control, Qt.Key_Alt, Qt.Key_Shift, Qt.Key_Meta,
|
||||||
Qt.Key_AltGr, Qt.Key_Super_L, Qt.Key_Super_R,
|
Qt.Key_AltGr, Qt.Key_Super_L, Qt.Key_Super_R,
|
||||||
Qt.Key_Hyper_L, Qt.Key_Hyper_R, Qt.Key_Direction_L,
|
Qt.Key_Hyper_L, Qt.Key_Hyper_R, Qt.Key_Direction_L,
|
||||||
|
Loading…
Reference in New Issue
Block a user