-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
30 lines (25 loc) · 778 Bytes
/
test.py
File metadata and controls
30 lines (25 loc) · 778 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
file = open("usb_hid_keys.h", "r")
lookup_dict = {}
class Key:
def __init__(self, lookup):
self.win = lookup['KEY_LGUI']
self.shift = lookup['KEY_MOD_LSHIFT']
self.ctrl = lookup['KEY_MOD_LCTRL']
self.alt = lookup['KEY_MOD_LALT']
self.enter = lookup['KEY_ENTER']
self.lookup = lookup
# def sendString(self):
# self.
for line in file:
goodline = line[8:].split(" ")
if line.startswith("#define ") and len(goodline)>1:
key = goodline[0]
value = ""
for i in range(1, len(goodline)):
if goodline[i] == "":
continue
else:
value = goodline[i].rsplit()[0]
break
lookup_dict[key] = value
print(lookup_dict)