Skip to content

Commit 6e88816

Browse files
committed
Added support for WinKey modifier
1 parent 2bba0c3 commit 6e88816

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

pyhk.py

+13-5
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,9 @@ def createKeyLookup(self):
387387
89: 'Y',
388388
90: 'Z',
389389
91: 'Lwin',
390+
92: 'Rwin',
391+
93: 'App',
392+
95: 'Sleep',
390393
96: 'Numpad0',
391394
97: 'Numpad1',
392395
98: 'Numpad2',
@@ -440,7 +443,8 @@ def createKeyLookup(self):
440443
1005: 'mouse wheel down',
441444
1010: 'Ctrl', #merged hotkeys
442445
1011: 'Alt',
443-
1012: 'Shift'}
446+
1012: 'Shift',
447+
1013: 'Win'}
444448

445449
Key2ID = dict(map(lambda x,y: (x,y),ID2Key.values(),ID2Key.keys()))
446450

@@ -482,25 +486,29 @@ def createMergeKeys(self):
482486
164 1011 Alt (Lmenu)
483487
165 1011 Alt (Rmenu)
484488
160 1012 Shift (Lshift)
485-
161 1012 Shift (Rshift)"""
489+
161 1012 Shift (Rshift)
490+
91 1013 Win (Lwin)
491+
92 1013 Win (Rwin)"""
486492

487493
KeyID2MEID = {162:1010,
488494
163:1010,
489495
164:1011,
490496
165:1011,
491497
160:1012,
492-
161:1012}
498+
161:1012,
499+
91:1013,
500+
92:1013}
493501
return KeyID2MEID
494502

495503
def getHotkeyListNoSingleNoModifiers(self):
496504
"""return a list of all hotkeys without single events and modifiers"""
497505
TempID2Key = self.ID2Key.copy()
498506

499507
#get rid of single events and modifiers
500-
getRid = [160,161,162,163,164,165,1000,1004,1005,1010,1011,1012]
508+
getRid = [91,92,160,161,162,163,164,165,1000,1004,1005,1010,1011,1012,1013]
501509

502510
#get rid of Lwin and oems
503-
moreRid = [91,186,187,188,189,190,191,192,219,220,221,222]
511+
moreRid = [186,187,188,189,190,191,192,219,220,221,222]
504512

505513
for item in moreRid:
506514
getRid.append(item)

0 commit comments

Comments
 (0)