DP/app/hid.py

8 lines
260 B
Python
Raw Permalink Normal View History

2023-04-24 11:36:47 +00:00
def send(hid_path, control_keys, hid_keycode):
with open(hid_path, 'wb+') as hid_handle:
buf = [0] * 8
buf[0] = control_keys
buf[2] = hid_keycode
hid_handle.write(bytearray(buf))
hid_handle.write(bytearray([0] * 8))