|
6 | 6 | 0x05, 0x01, # Usage Page (Generic Desktop), |
7 | 7 | 0x09, 0x06, # Usage (Keyboard), |
8 | 8 | 0xA1, 0x01, # Collection (Application), |
9 | | - 0x85, 0xFF, # 6,7 Report ID [SET AT RUNTIME] |
| 9 | + 0x85, 0x04, # 6,7 Report ID |
10 | 10 | # bitmap of modifiers |
11 | 11 | 0x75, 0x01, # Report Size (1), |
12 | 12 | 0x95, 0x08, # Report Count (8), |
|
39 | 39 | )) |
40 | 40 |
|
41 | 41 | bitmap_keyboard = usb_hid.Device( |
42 | | - report_descriptor = bitmap_keyboard_descriptor, |
43 | | - usage_page = 0x1, |
44 | | - usage = 0x6, |
45 | | - in_report_length = 16, |
46 | | - out_report_length = 1, |
47 | | - report_id_index = BITMAP_KEYBOARD_DESCRIPTOR_REPORT_ID, |
| 42 | + report_descriptor=bitmap_keyboard_descriptor, |
| 43 | + usage_page=0x1, |
| 44 | + usage=0x6, |
| 45 | + report_ids=(4,), |
| 46 | + in_report_lengths=(16,), |
| 47 | + out_report_lengths=(1,), |
48 | 48 | ) |
49 | 49 |
|
50 | | -print(bitmap_keyboard) |
51 | | -devices = [ |
52 | | - bitmap_keyboard, |
53 | | - usb_hid.Device.CONSUMER_CONTROL, |
54 | | - usb_hid.Device.MOUSE, |
55 | | -] |
56 | | -usb_hid.enable(devices) |
57 | | -print("enabled HID with custom keyboard device") |
| 50 | +usb_hid.enable( |
| 51 | + ( |
| 52 | + bitmap_keyboard, |
| 53 | + usb_hid.Device.MOUSE, |
| 54 | + usb_hid.Device.CONSUMER_CONTROL, |
| 55 | + ) |
| 56 | +) |
| 57 | +print("enabled HID with custom keyboard device") |
0 commit comments