-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsteel.py
32 lines (27 loc) · 890 Bytes
/
steel.py
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
31
32
from pywinusb import hid
import time
import random
from SMTKeyboard import SMTKeyboard
from constants import constants
def random_color():
return random.choice(constants.colors.keys())
def random_intensity():
return random.choice(constants.levels.keys())
def shuffer(kbd):
kbd.set_color('left',random_color(),random_intensity())
kbd.set_color('middle',random_color(),random_intensity())
kbd.set_color('right',random_color(),random_intensity())
if __name__ == "__main__":
filter = hid.HidDeviceFilter(vendor_id = 6000, product_id = 65280)
hid_device = filter.get_devices()
device = hid_device[0]
try:
device.open(output_only = True )
kbd = SMTKeyboard(device)
for i in range(10):
shuffer(kbd)
time.sleep(0.1)
kbd.set_mode("normal")
print kbd.current
finally:
device.close()