In some github projects I have seen that for HID keyboard report it is used a python structure like the following:
self.state = [
0xA1, # This is an input report
0x01, # Usage report = Keyboard
# Bit array for Modifier keys (D7 being the first element, D0 being last)
[0, # Right GUI - (usually the Windows key)
0, # Right ALT
0, # Right Shift
0, # Right Control
0, # Left GUI - (again, usually the Windows key)
0, # Left ALT
0, # Left Shift
0], # Left Control
0x00, # Vendor reserved
0x00, # Rest is space for 6 keys
0x00,
0x00,
0x00,
0x00,
0x00 ]
I have some doubts regarding the first two bytes that appears in the structure, 0xA1 and 0x01, because the data with the keyboard information is really the rest.
Do HID reports start always with 0xA1?
If the value (0x01) of the second byte means "report usage = keyboard", what value correspond to a gamepad?
Thank for your help.