OK, I’ve done some more research and I’ve found that I was completely off base with regard to /dev/input/event*
. It does seem to be related to the USB events and contain a version of the HID report, but it definitely isn’t the raw report.
What I have found is a pair of utilities, usbhid-dump
and rd.rex
that can be used to see and understand the raw reports.
usbhid-dump
may have a package already for your distribution.
rd.rex
is a rexx script that I found at https://github.com/abend0c1/hidrdd
The basics of all of this is that a USB device sends a “report descriptor” to the host telling the host what types of data will be sent and how it will be structured.
The command usbhid-dump --address=bus[:dev] -ed
will produce the list of descriptors the device provides (my Model01 provides three), where you need to supply the bus and device number for your keyboard. Note that I’ve had this effectively disconnect my keyboard, requiring me to unplug it and plug it back in.
The descriptor sent by my Model01 for the primary device is:
05 01 09 80 A1 01 85 05 15 00 26 FF 00 19 00 29
FF 95 01 75 08 81 00 C0 05 01 09 06 A1 01 85 08
05 07 19 E0 29 E7 15 00 25 01 75 01 95 08 81 02
05 08 19 01 29 08 95 08 75 01 91 02 05 07 75 04
95 01 81 01 19 04 29 31 15 00 25 01 75 01 95 2E
81 02 75 01 95 01 81 01 19 33 29 9B 15 00 25 01
75 01 95 69 81 02 75 01 95 01 81 01 19 9D 29 DD
15 00 25 01 75 01 95 41 81 02 75 02 95 01 81 01
C0 05 0C 09 01 A1 01 85 04 15 00 26 FF 03 19 00
2A FF 03 95 04 75 10 81 00 C0 05 01 09 02 A1 01
85 01 05 09 19 01 29 08 15 00 25 01 95 08 75 01
81 02 05 01 09 30 09 31 09 38 15 81 25 7F 75 08
95 03 81 06 05 0C 0A 38 02 15 81 25 7F 75 08 95
01 81 06 C0
The secondary interface seems to be the other mouse, while the interface device seems very odd.
rd.rex
can then decode that descriptor information into something easier for a person to read, both as a structured interpretation of the numbers and as a C struct. The interpretation of that descriptor is 439 lines long, so I won’t include it here.
Armed with this information, you can use usbhid-dump --address=bus[:dev] -es
to show you the reports in the same format as promised by the descriptor (hopefully). Note that this disconnects the keyboard from all other input sources (such as X and the kernel) for the duration of the capture so it is advised to have a second keyboard. Note also that sometimes my keyboard doesn’t reconnect automatically afterwards, requiring replugging.
I’m very sorry for the initial wrong information.
Edit: I initially pasted in some other descriptor besides the main one for the KeyboardIO Model01 - now corrected.