sphinx.addnodesdocument)}( rawsource children](translations
LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}(hhparenthuba
attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget /translations/zh_CN/hid/hidintromodnameN classnameNrefexplicitutagnamehhhubh)}(hhh]hChinese (Traditional)}(hhhh2ubah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget /translations/zh_TW/hid/hidintromodnameN classnameNrefexplicituh1hhhubh)}(hhh]hItalian}(hhhhFubah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget /translations/it_IT/hid/hidintromodnameN classnameNrefexplicituh1hhhubh)}(hhh]hJapanese}(hhhhZubah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget /translations/ja_JP/hid/hidintromodnameN classnameNrefexplicituh1hhhubh)}(hhh]hKorean}(hhhhnubah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget /translations/ko_KR/hid/hidintromodnameN classnameNrefexplicituh1hhhubh)}(hhh]hSpanish}(hhhhubah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget /translations/sp_SP/hid/hidintromodnameN classnameNrefexplicituh1hhhubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h
hh _documenthsourceNlineNubhcomment)}(h SPDX-License-Identifier: GPL-2.0h]h SPDX-License-Identifier: GPL-2.0}(hhhhubah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhh:/var/lib/git/docbuild/linux/Documentation/hid/hidintro.rsthKubhsection)}(hhh](htitle)}(h&Introduction to HID report descriptorsh]h&Introduction to HID report descriptors}(hhhhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh paragraph)}(hThis chapter is meant to give a broad overview of what HID report
descriptors are, and of how a casual (non-kernel) programmer can deal
with HID devices that are not working well with Linux.h]hThis chapter is meant to give a broad overview of what HID report
descriptors are, and of how a casual (non-kernel) programmer can deal
with HID devices that are not working well with Linux.}(hhhhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubhtopic)}(hhh]hbullet_list)}(hhh](h list_item)}(hhh]h)}(hhh]h reference)}(hhh]hIntroduction}(hIntroductionhhhhhNhNubah}(h]id4ah ]h"]h$]h&]refidintroductionuh1hhhubah}(h]h ]h"]h$]h&]uh1hhhubah}(h]h ]h"]h$]h&]uh1hhhubh)}(hhh](h)}(hhh]h)}(hhh]hParsing HID report descriptors}(hParsing HID report descriptorshj hhhNhNubah}(h]id5ah ]h"]h$]h&]refidparsing-hid-report-descriptorsuh1hhj
ubah}(h]h ]h"]h$]h&]uh1hhj
ubh)}(hhh]h)}(hhh]h)}(hhh]h)}(hhh]h!Output, Input and Feature Reports}(h!Output, Input and Feature Reportshj0 hhhNhNubah}(h]id6ah ]h"]h$]h&]refid output-input-and-feature-reportsuh1hhj- ubah}(h]h ]h"]h$]h&]uh1hhj* ubah}(h]h ]h"]h$]h&]uh1hhj' ubah}(h]h ]h"]h$]h&]uh1hhj
ubeh}(h]h ]h"]h$]h&]uh1hhhubh)}(hhh]h)}(hhh]h)}(hhh]h(Collections, Report IDs and Evdev events}(h(Collections, Report IDs and Evdev eventshj_ hhhNhNubah}(h]id7ah ]h"]h$]h&]refid'collections-report-ids-and-evdev-eventsuh1hhj\ ubah}(h]h ]h"]h$]h&]uh1hhjY ubah}(h]h ]h"]h$]h&]uh1hhhubh)}(hhh]h)}(hhh]h)}(hhh]hEvents}(hEventshj hhhNhNubah}(h]id8ah ]h"]h$]h&]refideventsuh1hhj ubah}(h]h ]h"]h$]h&]uh1hhj| ubah}(h]h ]h"]h$]h&]uh1hhhubh)}(hhh](h)}(hhh]h)}(hhh]hWhen something does not work}(hWhen something does not workhj hhhNhNubah}(h]id9ah ]h"]h$]h&]refidwhen-something-does-not-workuh1hhj ubah}(h]h ]h"]h$]h&]uh1hhj ubh)}(hhh](h)}(hhh]h)}(hhh]h)}(hhh]hQuirks}(hQuirkshj hhhNhNubah}(h]id10ah ]h"]h$]h&]refidquirksuh1hhj ubah}(h]h ]h"]h$]h&]uh1hhj ubah}(h]h ]h"]h$]h&]uh1hhj ubh)}(hhh]h)}(hhh]h)}(hhh]hFixing HID report descriptors}(hFixing HID report descriptorshj hhhNhNubah}(h]id11ah ]h"]h$]h&]refidfixing-hid-report-descriptorsuh1hhj ubah}(h]h ]h"]h$]h&]uh1hhj ubah}(h]h ]h"]h$]h&]uh1hhj ubh)}(hhh]h)}(hhh]h)}(hhh]h)Modifying the transmitted data on the fly}(h)Modifying the transmitted data on the flyhj hhhNhNubah}(h]id12ah ]h"]h$]h&]refid)modifying-the-transmitted-data-on-the-flyuh1hhj ubah}(h]h ]h"]h$]h&]uh1hhj ubah}(h]h ]h"]h$]h&]uh1hhj ubh)}(hhh]h)}(hhh]h)}(hhh]hWriting a specialized driver}(hWriting a specialized driverhj. hhhNhNubah}(h]id13ah ]h"]h$]h&]refidwriting-a-specialized-driveruh1hhj+ ubah}(h]h ]h"]h$]h&]uh1hhj( ubah}(h]h ]h"]h$]h&]uh1hhj ubeh}(h]h ]h"]h$]h&]uh1hhj ubeh}(h]h ]h"]h$]h&]uh1hhhubeh}(h]h ]h"]h$]h&]uh1hhhhhhNhNubah}(h]contentsah ](contentslocaleh"]contentsah$]h&]uh1hhhhK
hhhhubhcompound)}(hhh]h toctree)}(hhh]h}(h]h ]h"]h$]h&]hhid/hidintroentries]Nhid/hidreport-parsingaincludefiles]jz amaxdepthKcaptionNglobhidden
includehiddennumberedK
titlesonly
rawentries]uh1jl hhhKhji ubah}(h]h ]toctree-wrapperah"]h$]h&]uh1jg hhhhhhhNubh)}(hhh](h)}(hhh]hIntroduction}(hhhj hhhNhNubah}(h]h ]h"]h$]h&]refidhuh1hhj hhhhhKubh)}(hHID stands for Human Interface Device, and can be whatever device you
are using to interact with a computer, be it a mouse, a touchpad, a
tablet, a microphone.h]hHID stands for Human Interface Device, and can be whatever device you
are using to interact with a computer, be it a mouse, a touchpad, a
tablet, a microphone.}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubh)}(hXk Many HID devices work out the box, even if their hardware is different.
For example, mice can have any number of buttons; they may have a
wheel; movement sensitivity differs between different models, and so
on. Nonetheless, most of the time everything just works, without the
need to have specialized code in the kernel for every mouse model
developed since 1970.h]hXk Many HID devices work out the box, even if their hardware is different.
For example, mice can have any number of buttons; they may have a
wheel; movement sensitivity differs between different models, and so
on. Nonetheless, most of the time everything just works, without the
need to have specialized code in the kernel for every mouse model
developed since 1970.}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubh)}(hX This is because modern HID devices do advertise their capabilities
through the *HID report descriptor*, a fixed set of bytes describing
exactly what *HID reports* may be sent between the device and the host
and the meaning of each individual bit in those reports. For example,
a HID Report Descriptor may specify that "in a report with ID 3 the
bits from 8 to 15 is the delta x coordinate of a mouse".h](hOThis is because modern HID devices do advertise their capabilities
through the }(hOThis is because modern HID devices do advertise their capabilities
through the hj hhhNhNubhemphasis)}(h*HID report descriptor*h]hHID report descriptor}(hhhj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj ubh/, a fixed set of bytes describing
exactly what }(h/, a fixed set of bytes describing
exactly what hj hhhNhNubj )}(h
*HID reports*h]hHID reports}(hhhj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj ubh may be sent between the device and the host
and the meaning of each individual bit in those reports. For example,
a HID Report Descriptor may specify that “in a report with ID 3 the
bits from 8 to 15 is the delta x coordinate of a mouse”.}(h may be sent between the device and the host
and the meaning of each individual bit in those reports. For example,
a HID Report Descriptor may specify that "in a report with ID 3 the
bits from 8 to 15 is the delta x coordinate of a mouse".hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK#hj hhubh)}(hXU The HID report itself then merely carries the actual data values
without any extra meta information. Note that HID reports may be sent
from the device ("Input Reports", i.e. input events), to the device
("Output Reports" to e.g. change LEDs) or used for device configuration
("Feature reports"). A device may support one or more HID reports.h]hXa The HID report itself then merely carries the actual data values
without any extra meta information. Note that HID reports may be sent
from the device (“Input Reports”, i.e. input events), to the device
(“Output Reports” to e.g. change LEDs) or used for device configuration
(“Feature reports”). A device may support one or more HID reports.}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK*hj hhubh)}(hX The HID subsystem is in charge of parsing the HID report descriptors,
and converts HID events into normal input device interfaces (see
Documentation/hid/hid-transport.rst). Devices may misbehave because the
HID report descriptor provided by the device is wrong, or because it
needs to be dealt with in a special way, or because some special
device or interaction mode is not handled by the default code.h]hX The HID subsystem is in charge of parsing the HID report descriptors,
and converts HID events into normal input device interfaces (see
Documentation/hid/hid-transport.rst). Devices may misbehave because the
HID report descriptor provided by the device is wrong, or because it
needs to be dealt with in a special way, or because some special
device or interaction mode is not handled by the default code.}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK0hj hhubh)}(hThe format of HID report descriptors is described by two documents,
available from the `USB Implementers Forum `_
`HID web page `_ address:h](hWThe format of HID report descriptors is described by two documents,
available from the }(hWThe format of HID report descriptors is described by two documents,
available from the hj hhhNhNubh)}(h0`USB Implementers Forum `_h]hUSB Implementers Forum}(hUSB Implementers Forumhj hhhNhNubah}(h]h ]h"]h$]h&]nameUSB Implementers Forumrefurihttps://www.usb.org/uh1hhj ubhtarget)}(h h]h}(h]usb-implementers-forumah ]h"]usb implementers forumah$]h&]refurij) uh1j*
referencedKhj ubh
}(h
hj hhhNhNubh)}(h)`HID web page `_h]hHID web page}(hHID web pagehj? hhhNhNubah}(h]h ]h"]h$]h&]nameHID web pagej( https://www.usb.org/hiduh1hhj ubj+ )}(h h]h}(h]hid-web-pageah ]h"]hid web pageah$]h&]refurijP uh1j* j9 Khj ubh address:}(h address:hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK7hj hhubhblock_quote)}(hhh]h)}(hhh](h)}(hthe `HID USB Device Class Definition
`_ (HID Spec from now on)h]h)}(hthe `HID USB Device Class Definition
`_ (HID Spec from now on)h](hthe }(hthe hju hhhNhNubh)}(hi`HID USB Device Class Definition
`_h]hHID USB Device Class Definition}(hHID USB Device Class Definitionhj~ hhhNhNubah}(h]h ]h"]h$]h&]nameHID USB Device Class Definitionj( Dhttps://www.usb.org/document-library/device-class-definition-hid-111uh1hhju ubj+ )}(hG
h]h}(h]hid-usb-device-class-definitionah ]h"]hid usb device class definitionah$]h&]refurij uh1j* j9 Khju ubh (HID Spec from now on)}(h (HID Spec from now on)hju hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK;hjq ubah}(h]h ]h"]h$]h&]uh1hhjn ubh)}(hathe `HID Usage Tables `_ (HUT from now on)
h]h)}(h`the `HID Usage Tables `_ (HUT from now on)h](hthe }(hthe hj hhhNhNubh)}(hJ`HID Usage Tables `_h]hHID Usage Tables}(hHID Usage Tableshj hhhNhNubah}(h]h ]h"]h$]h&]nameHID Usage Tablesj( 4https://usb.org/document-library/hid-usage-tables-14uh1hhj ubj+ )}(h7 h]h}(h]hid-usage-tablesah ]h"]hid usage tablesah$]h&]refurij uh1j* j9 Khj ubh (HUT from now on)}(h (HUT from now on)hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK=hj ubah}(h]h ]h"]h$]h&]uh1hhjn ubeh}(h]h ]h"]h$]h&]bullet*uh1hhhhK;hjk ubah}(h]h ]h"]h$]h&]uh1ji hj hhhNhNubh)}(hThe HID subsystem can deal with different transport drivers
(USB, I2C, Bluetooth, etc.). See Documentation/hid/hid-transport.rst.h]hThe HID subsystem can deal with different transport drivers
(USB, I2C, Bluetooth, etc.). See Documentation/hid/hid-transport.rst.}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK?hj hhubeh}(h]hah ]h"]introductionah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hj h]hParsing HID report descriptors}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]j j uh1hhj hhhhhKCubh)}(hThe current list of HID devices can be found at ``/sys/bus/hid/devices/``.
For each device, say ``/sys/bus/hid/devices/0003\:093A\:2510.0002/``,
one can read the corresponding report descriptor::h](h0The current list of HID devices can be found at }(h0The current list of HID devices can be found at hj hhhNhNubhliteral)}(h``/sys/bus/hid/devices/``h]h/sys/bus/hid/devices/}(hhhj) hhhNhNubah}(h]h ]h"]h$]h&]uh1j' hj ubh.
For each device, say }(h.
For each device, say hj hhhNhNubj( )}(h/``/sys/bus/hid/devices/0003\:093A\:2510.0002/``h]h+/sys/bus/hid/devices/0003\:093A\:2510.0002/}(hhhj< hhhNhNubah}(h]h ]h"]h$]h&]uh1j' hj ubh3,
one can read the corresponding report descriptor:}(h3,
one can read the corresponding report descriptor:hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKEhj hhubh
literal_block)}(hX $ hexdump -C /sys/bus/hid/devices/0003\:093A\:2510.0002/report_descriptor
00000000 05 01 09 02 a1 01 09 01 a1 00 05 09 19 01 29 03 |..............).|
00000010 15 00 25 01 75 01 95 03 81 02 75 05 95 01 81 01 |..%.u.....u.....|
00000020 05 01 09 30 09 31 09 38 15 81 25 7f 75 08 95 03 |...0.1.8..%.u...|
00000030 81 06 c0 c0 |....|
00000034h]hX $ hexdump -C /sys/bus/hid/devices/0003\:093A\:2510.0002/report_descriptor
00000000 05 01 09 02 a1 01 09 01 a1 00 05 09 19 01 29 03 |..............).|
00000010 15 00 25 01 75 01 95 03 81 02 75 05 95 01 81 01 |..%.u.....u.....|
00000020 05 01 09 30 09 31 09 38 15 81 25 7f 75 08 95 03 |...0.1.8..%.u...|
00000030 81 06 c0 c0 |....|
00000034}(hhhjW ubah}(h]h ]h"]h$]h&]hhuh1jU hhhKIhj hhubh)}(hhOptional: the HID report descriptor can be read also by
directly accessing the hidraw driver [#hidraw]_.h](h]Optional: the HID report descriptor can be read also by
directly accessing the hidraw driver }(h]Optional: the HID report descriptor can be read also by
directly accessing the hidraw driver hje hhhNhNubhfootnote_reference)}(h
[#hidraw]_h]h1}(hhhjp hhhNhNubah}(h]id1ah ]h"]h$]h&]autoKj hidrawdocnamejw uh1jn hje resolvedKubh.}(h.hje hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKPhj hhubh)}(hX The basic structure of HID report descriptors is defined in the HID
spec, while HUT "defines constants that can be interpreted by an
application to identify the purpose and meaning of a data field in a
HID report". Each entry is defined by at least two bytes, where the
first one defines what type of value is following and is described in
the HID spec, while the second one carries the actual value and is
described in the HUT.h]hX The basic structure of HID report descriptors is defined in the HID
spec, while HUT “defines constants that can be interpreted by an
application to identify the purpose and meaning of a data field in a
HID report”. Each entry is defined by at least two bytes, where the
first one defines what type of value is following and is described in
the HID spec, while the second one carries the actual value and is
described in the HUT.}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKShj hhubh)}(hXHID report descriptors can, in principle, be painstakingly parsed by
hand, byte by byte.h]hXHID report descriptors can, in principle, be painstakingly parsed by
hand, byte by byte.}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK[hj hhubh)}(hA short introduction on how to do this is sketched in
Documentation/hid/hidreport-parsing.rst; you only need to understand it
if you need to patch HID report descriptors.h]hA short introduction on how to do this is sketched in
Documentation/hid/hidreport-parsing.rst; you only need to understand it
if you need to patch HID report descriptors.}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK^hj hhubh)}(hIn practice you should not parse HID report descriptors by hand; rather,
you should use an existing parser. Among all the available onesh]hIn practice you should not parse HID report descriptors by hand; rather,
you should use an existing parser. Among all the available ones}(hj hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKbhj hhubjj )}(hhh]h)}(hhh](h)}(h]the online `USB Descriptor and Request Parser
`_;h]h)}(h]the online `USB Descriptor and Request Parser
`_;h](hthe online }(hthe online hj hhhNhNubh)}(hQ`USB Descriptor and Request Parser
`_h]h!USB Descriptor and Request Parser}(h!USB Descriptor and Request Parserhj hhhNhNubah}(h]h ]h"]h$]h&]name!USB Descriptor and Request Parserj( *http://eleccelerator.com/usbdescreqparser/uh1hhj ubj+ )}(h-
h]h}(h]!usb-descriptor-and-request-parserah ]h"]!usb descriptor and request parserah$]h&]refurij uh1j* j9 Khj ubh;}(h;hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKehj ubah}(h]h ]h"]h$]h&]uh1hhj ubh)}(h`hidrdd `_,
that provides very detailed and somewhat verbose descriptions
(verbosity can be useful if you are not familiar with HID report
descriptors);h]h)}(h`hidrdd `_,
that provides very detailed and somewhat verbose descriptions
(verbosity can be useful if you are not familiar with HID report
descriptors);h](h)}(h.`hidrdd `_h]hhidrdd}(hhidrddhj hhhNhNubah}(h]h ]h"]h$]h&]namej j( "https://github.com/abend0c1/hidrdduh1hhj
ubj+ )}(h% h]h}(h]hidrddah ]h"]hidrddah$]h&]refurij! uh1j* j9 Khj
ubh,
that provides very detailed and somewhat verbose descriptions
(verbosity can be useful if you are not familiar with HID report
descriptors);}(h,
that provides very detailed and somewhat verbose descriptions
(verbosity can be useful if you are not familiar with HID report
descriptors);hj
hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKghj ubah}(h]h ]h"]h$]h&]uh1hhj ubh)}(hX `hid-tools `_,
a complete utility set that allows, among other things,
to record and replay the raw HID reports and to debug
and replay HID devices.
It is being actively developed by the Linux HID subsystem maintainers.
h]h)}(hX `hid-tools `_,
a complete utility set that allows, among other things,
to record and replay the raw HID reports and to debug
and replay HID devices.
It is being actively developed by the Linux HID subsystem maintainers.h](h)}(h@`hid-tools `_h]h hid-tools}(h hid-toolshjH hhhNhNubah}(h]h ]h"]h$]h&]namejP j( 1https://gitlab.freedesktop.org/libevdev/hid-toolsuh1hhjD ubj+ )}(h4 h]h}(h] hid-toolsah ]h"] hid-toolsah$]h&]refurijX uh1j* j9 KhjD ubh,
a complete utility set that allows, among other things,
to record and replay the raw HID reports and to debug
and replay HID devices.
It is being actively developed by the Linux HID subsystem maintainers.}(h,
a complete utility set that allows, among other things,
to record and replay the raw HID reports and to debug
and replay HID devices.
It is being actively developed by the Linux HID subsystem maintainers.hjD hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKkhj@ ubah}(h]h ]h"]h$]h&]uh1hhj ubeh}(h]h ]h"]h$]h&]j j uh1hhhhKehj ubah}(h]h ]h"]h$]h&]uh1ji hj hhhNhNubh)}(hParsing the mouse HID report descriptor with `hid-tools
`_ leads to
(explanations interposed)::h](h-Parsing the mouse HID report descriptor with }(h-Parsing the mouse HID report descriptor with hj hhhNhNubh)}(h@`hid-tools
`_h]h hid-tools}(h hid-toolshj hhhNhNubah}(h]h ]h"]h$]h&]namej j( 1https://gitlab.freedesktop.org/libevdev/hid-toolsuh1hhj ubj+ )}(h4
h]h}(h]id2ah ]h"]h$] hid-toolsah&]refurij uh1j* j9 Khj ubh$ leads to
(explanations interposed):}(h$ leads to
(explanations interposed):hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKqhj hhubjV )}(hX $ ./hid-decode /sys/bus/hid/devices/0003\:093A\:2510.0002/report_descriptor
# device 0:0
# 0x05, 0x01, // Usage Page (Generic Desktop) 0
# 0x09, 0x02, // Usage (Mouse) 2
# 0xa1, 0x01, // Collection (Application) 4
# 0x09, 0x01, // Usage (Pointer) 6
# 0xa1, 0x00, // Collection (Physical) 8
# 0x05, 0x09, // Usage Page (Button) 10h]hX $ ./hid-decode /sys/bus/hid/devices/0003\:093A\:2510.0002/report_descriptor
# device 0:0
# 0x05, 0x01, // Usage Page (Generic Desktop) 0
# 0x09, 0x02, // Usage (Mouse) 2
# 0xa1, 0x01, // Collection (Application) 4
# 0x09, 0x01, // Usage (Pointer) 6
# 0xa1, 0x00, // Collection (Physical) 8
# 0x05, 0x09, // Usage Page (Button) 10}(hhhj ubah}(h]h ]h"]h$]h&]hhuh1jU hhhKuhj hhubh)}(hwhat follows is a button ::h]hwhat follows is a button}(hwhat follows is a buttonhj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK~hj hhubjV )}(h# 0x19, 0x01, // Usage Minimum (1) 12
# 0x29, 0x03, // Usage Maximum (3) 14h]h# 0x19, 0x01, // Usage Minimum (1) 12
# 0x29, 0x03, // Usage Maximum (3) 14}(hhhj ubah}(h]h ]h"]h$]h&]hhuh1jU hhhKhj hhubh)}(hBfirst button is button number 1, last button is button number 3 ::h]h?first button is button number 1, last button is button number 3}(h?first button is button number 1, last button is button number 3hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubjV )}(h# 0x15, 0x00, // Logical Minimum (0) 16
# 0x25, 0x01, // Logical Maximum (1) 18h]h# 0x15, 0x00, // Logical Minimum (0) 16
# 0x25, 0x01, // Logical Maximum (1) 18}(hhhj ubah}(h]h ]h"]h$]h&]hhuh1jU hhhKhj hhubh)}(hVeach button can send values from 0 up to including 1
(i.e. they are binary buttons) ::h]hSeach button can send values from 0 up to including 1
(i.e. they are binary buttons)}(hSeach button can send values from 0 up to including 1
(i.e. they are binary buttons)hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubjV )}(hI# 0x75, 0x01, // Report Size (1) 20h]hI# 0x75, 0x01, // Report Size (1) 20}(hhhj ubah}(h]h ]h"]h$]h&]hhuh1jU hhhKhj hhubh)}(h)each button is sent as exactly one bit ::h]h&each button is sent as exactly one bit}(h&each button is sent as exactly one bithj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubjV )}(hI# 0x95, 0x03, // Report Count (3) 22h]hI# 0x95, 0x03, // Report Count (3) 22}(hhhj) ubah}(h]h ]h"]h$]h&]hhuh1jU hhhKhj hhubh)}(hAand there are three of those bits (matching the three buttons) ::h]h>and there are three of those bits (matching the three buttons)}(h>and there are three of those bits (matching the three buttons)hj7 hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubjV )}(hI# 0x81, 0x02, // Input (Data,Var,Abs) 24h]hI# 0x81, 0x02, // Input (Data,Var,Abs) 24}(hhhjF ubah}(h]h ]h"]h$]h&]hhuh1jU hhhKhj hhubh)}(hit's actual Data (not constant padding), they represent
a single variable (Var) and their values are Absolute (not relative);
See HID spec Sec. 6.2.2.5 "Input, Output, and Feature Items" ::h]hit’s actual Data (not constant padding), they represent
a single variable (Var) and their values are Absolute (not relative);
See HID spec Sec. 6.2.2.5 “Input, Output, and Feature Items”}(hit's actual Data (not constant padding), they represent
a single variable (Var) and their values are Absolute (not relative);
See HID spec Sec. 6.2.2.5 "Input, Output, and Feature Items"hjT hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubjV )}(hI# 0x75, 0x05, // Report Size (5) 26h]hI# 0x75, 0x05, // Report Size (5) 26}(hhhjc ubah}(h]h ]h"]h$]h&]hhuh1jU hhhKhj hhubh)}(h7five additional padding bits, needed to reach a byte ::h]h4five additional padding bits, needed to reach a byte}(h4five additional padding bits, needed to reach a bytehjq hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubjV )}(hI# 0x95, 0x01, // Report Count (1) 28h]hI# 0x95, 0x01, // Report Count (1) 28}(hhhj ubah}(h]h ]h"]h$]h&]hhuh1jU hhhKhj hhubh)}(h)those five bits are repeated only once ::h]h&those five bits are repeated only once}(h&those five bits are repeated only oncehj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubjV )}(hI# 0x81, 0x01, // Input (Cnst,Arr,Abs) 30h]hI# 0x81, 0x01, // Input (Cnst,Arr,Abs) 30}(hhhj ubah}(h]h ]h"]h$]h&]hhuh1jU hhhKhj hhubh)}(h