}sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget/translations/zh_CN/hid/hiddevmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget/translations/zh_TW/hid/hiddevmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget/translations/it_IT/hid/hiddevmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget/translations/ja_JP/hid/hiddevmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget/translations/ko_KR/hid/hiddevmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget/translations/sp_SP/hid/hiddevmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhsection)}(hhh](htitle)}(h0Care and feeding of your Human Interface Devicesh]h0Care and feeding of your Human Interface Devices}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhh8/var/lib/git/docbuild/linux/Documentation/hid/hiddev.rsthKubh)}(hhh](h)}(h Introductionh]h Introduction}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh paragraph)}(hXLIn addition to the normal input type HID devices, USB also uses the human interface device protocols for things that are not really human interfaces, but have similar sorts of communication needs. The two big examples for this are power devices (especially uninterruptible power supplies) and monitor control on higher end monitors.h]hXLIn addition to the normal input type HID devices, USB also uses the human interface device protocols for things that are not really human interfaces, but have similar sorts of communication needs. The two big examples for this are power devices (especially uninterruptible power supplies) and monitor control on higher end monitors.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hXkTo support these disparate requirements, the Linux USB system provides HID events to two separate interfaces: * the input subsystem, which converts HID events into normal input device interfaces (such as keyboard, mouse and joystick) and a normalised event interface - see Documentation/input/input.rst * the hiddev interface, which provides fairly raw HID eventsh]hXkTo support these disparate requirements, the Linux USB system provides HID events to two separate interfaces: * the input subsystem, which converts HID events into normal input device interfaces (such as keyboard, mouse and joystick) and a normalised event interface - see Documentation/input/input.rst * the hiddev interface, which provides fairly raw HID events}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hTThe data flow for a HID event produced by a device is something like the following::h]hSThe data flow for a HID event produced by a device is something like the following:}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh literal_block)}(husb.c ---> hid-core.c ----> hid-input.c ----> [keyboard/mouse/joystick/event] | | --> hiddev.c ----> POWER / MONITOR CONTROLh]husb.c ---> hid-core.c ----> hid-input.c ----> [keyboard/mouse/joystick/event] | | --> hiddev.c ----> POWER / MONITOR CONTROL}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhKhhhhubh)}(hIn addition, other subsystems (apart from USB) can potentially feed events into the input subsystem, but these have no effect on the HID device interface.h]hIn addition, other subsystems (apart from USB) can potentially feed events into the input subsystem, but these have no effect on the HID device interface.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubeh}(h] introductionah ]h"] introductionah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hUsing the HID Device Interfaceh]hUsing the HID Device Interface}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK"ubh)}(hThe hiddev interface is a char interface using the normal USB major, with the minor numbers starting at 96 and finishing at 111. Therefore, you need the following commands::h]hThe hiddev interface is a char interface using the normal USB major, with the minor numbers starting at 96 and finishing at 111. Therefore, you need the following commands:}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK$hjhhubh)}(hXmknod /dev/usb/hiddev0 c 180 96 mknod /dev/usb/hiddev1 c 180 97 mknod /dev/usb/hiddev2 c 180 98 mknod /dev/usb/hiddev3 c 180 99 mknod /dev/usb/hiddev4 c 180 100 mknod /dev/usb/hiddev5 c 180 101 mknod /dev/usb/hiddev6 c 180 102 mknod /dev/usb/hiddev7 c 180 103 mknod /dev/usb/hiddev8 c 180 104 mknod /dev/usb/hiddev9 c 180 105 mknod /dev/usb/hiddev10 c 180 106 mknod /dev/usb/hiddev11 c 180 107 mknod /dev/usb/hiddev12 c 180 108 mknod /dev/usb/hiddev13 c 180 109 mknod /dev/usb/hiddev14 c 180 110 mknod /dev/usb/hiddev15 c 180 111h]hXmknod /dev/usb/hiddev0 c 180 96 mknod /dev/usb/hiddev1 c 180 97 mknod /dev/usb/hiddev2 c 180 98 mknod /dev/usb/hiddev3 c 180 99 mknod /dev/usb/hiddev4 c 180 100 mknod /dev/usb/hiddev5 c 180 101 mknod /dev/usb/hiddev6 c 180 102 mknod /dev/usb/hiddev7 c 180 103 mknod /dev/usb/hiddev8 c 180 104 mknod /dev/usb/hiddev9 c 180 105 mknod /dev/usb/hiddev10 c 180 106 mknod /dev/usb/hiddev11 c 180 107 mknod /dev/usb/hiddev12 c 180 108 mknod /dev/usb/hiddev13 c 180 109 mknod /dev/usb/hiddev14 c 180 110 mknod /dev/usb/hiddev15 c 180 111}hj;sbah}(h]h ]h"]h$]h&]jjuh1hhhhK(hjhhubh)}(hvSo you point your hiddev compliant user-space program at the correct interface for your device, and it all just works.h]hvSo you point your hiddev compliant user-space program at the correct interface for your device, and it all just works.}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK9hjhhubh)}(hkAssuming that you have a hiddev compliant user-space program, of course. If you need to write one, read on.h]hkAssuming that you have a hiddev compliant user-space program, of course. If you need to write one, read on.}(hjWhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK, along with some other useful #defines and structures. The HID usage identifier is a composite of the HID usage page shifted to the 16 high order bits ORed with the usage code. The behavior of the read() function can be modified using the HIDIOCSFLAG ioctl() described below.h]hXcontaining the HID usage identifier for the status that changed, and the value that it was changed to. Note that the structure is defined within , along with some other useful #defines and structures. The HID usage identifier is a composite of the HID usage page shifted to the 16 high order bits ORed with the usage code. The behavior of the read() function can be modified using the HIDIOCSFLAG ioctl() described below.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK]hjhhubeh}(h]readah ]h"]read():ah$]h&]uh1hhjmhhhhhKOubh)}(hhh](h)}(hioctl():h]hioctl():}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKgubh)}(h>This is the control interface. There are a number of controls:h]h>This is the control interface. There are a number of controls:}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKihjhhubhdefinition_list)}(hhh](hdefinition_list_item)}(hNHIDIOCGVERSION - int (read) Gets the version code out of the hiddev driver. h](hterm)}(hHIDIOCGVERSIONh]hHIDIOCGVERSION}(hj?hhhNhNubah}(h]h ]h"]h$]h&]uh1j=hhhKnhj9ubh definition)}(hhh](h block_quote)}(h - int (read) h]h bullet_list)}(hhh]h list_item)}(h int (read) h]h)}(h int (read)h]h int (read)}(hjchhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKlhj_ubah}(h]h ]h"]h$]h&]uh1j]hjZubah}(h]h ]h"]h$]h&]bullet-uh1jXhhhKlhjTubah}(h]h ]h"]h$]h&]uh1jRhhhKlhjOubh)}(h/Gets the version code out of the hiddev driver.h]h/Gets the version code out of the hiddev driver.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKnhjOubeh}(h]h ]h"]h$]h&]uh1jMhj9ubeh}(h]h ]h"]h$]h&]uh1j7hhhKnhj4ubj8)}(hHIDIOCAPPLICATION - (none) h](j>)}(hHIDIOCAPPLICATIONh]hHIDIOCAPPLICATION}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j=hhhKqhjubjN)}(hhh]jY)}(hhh]j^)}(h(none) h]h)}(h(none)h]h(none)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKqhjubah}(h]h ]h"]h$]h&]uh1j]hjubah}(h]h ]h"]h$]h&]j}j~uh1jXhhhKqhjubah}(h]h ]h"]h$]h&]uh1jMhjubeh}(h]h ]h"]h$]h&]uh1j7hhhKqhj4hhubeh}(h]h ]h"]h$]h&]uh1j2hjhhhhhNubh)}(hXThis ioctl call returns the HID application usage associated with the HID device. The third argument to ioctl() specifies which application index to get. This is useful when the device has more than one application collection. If the index is invalid (greater or equal to the number of application collections this device has) the ioctl returns -1. You can find out beforehand how many application collections the device has from the num_applications field from the hiddev_devinfo structure.h]hXThis ioctl call returns the HID application usage associated with the HID device. The third argument to ioctl() specifies which application index to get. This is useful when the device has more than one application collection. If the index is invalid (greater or equal to the number of application collections this device has) the ioctl returns -1. You can find out beforehand how many application collections the device has from the num_applications field from the hiddev_devinfo structure.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKshjhhubj3)}(hhh]j8)}(hCHIDIOCGCOLLECTIONINFO - struct hiddev_collection_info (read/write) h](j>)}(hHIDIOCGCOLLECTIONINFOh]hHIDIOCGCOLLECTIONINFO}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j=hhhK}hjubjN)}(hhh]jY)}(hhh]j^)}(h+struct hiddev_collection_info (read/write) h]h)}(h*struct hiddev_collection_info (read/write)h]h*struct hiddev_collection_info (read/write)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK}hjubah}(h]h ]h"]h$]h&]uh1j]hj ubah}(h]h ]h"]h$]h&]j}j~uh1jXhhhK}hj ubah}(h]h ]h"]h$]h&]uh1jMhjubeh}(h]h ]h"]h$]h&]uh1j7hhhK}hjubah}(h]h ]h"]h$]h&]uh1j2hjhhhNhNubh)}(hXThis returns a superset of the information above, providing not only application collections, but all the collections the device has. It also returns the level the collection lives in the hierarchy. The user passes in a hiddev_collection_info struct with the index field set to the index that should be returned. The ioctl fills in the other fields. If the index is larger than the last collection index, the ioctl returns -1 and sets errno to -EINVAL.h]hXThis returns a superset of the information above, providing not only application collections, but all the collections the device has. It also returns the level the collection lives in the hierarchy. The user passes in a hiddev_collection_info struct with the index field set to the index that should be returned. The ioctl fills in the other fields. If the index is larger than the last collection index, the ioctl returns -1 and sets errno to -EINVAL.}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj3)}(hhh]j8)}(h.HIDIOCGDEVINFO - struct hiddev_devinfo (read) h](j>)}(hHIDIOCGDEVINFOh]hHIDIOCGDEVINFO}(hjUhhhNhNubah}(h]h ]h"]h$]h&]uh1j=hhhKhjQubjN)}(hhh]jY)}(hhh]j^)}(hstruct hiddev_devinfo (read) h]h)}(hstruct hiddev_devinfo (read)h]hstruct hiddev_devinfo (read)}(hjmhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjiubah}(h]h ]h"]h$]h&]uh1j]hjfubah}(h]h ]h"]h$]h&]j}j~uh1jXhhhKhjcubah}(h]h ]h"]h$]h&]uh1jMhjQubeh}(h]h ]h"]h$]h&]uh1j7hhhKhjNubah}(h]h ]h"]h$]h&]uh1j2hjhhhNhNubh)}(h;Gets a hiddev_devinfo structure which describes the device.h]h;Gets a hiddev_devinfo structure which describes the device.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj3)}(hhh]j8)}(h=HIDIOCGSTRING - struct hiddev_string_descriptor (read/write) h](j>)}(h HIDIOCGSTRINGh]h HIDIOCGSTRING}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j=hhhKhjubjN)}(hhh]jY)}(hhh]j^)}(h-struct hiddev_string_descriptor (read/write) h]h)}(h,struct hiddev_string_descriptor (read/write)h]h,struct hiddev_string_descriptor (read/write)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j]hjubah}(h]h ]h"]h$]h&]j}j~uh1jXhhhKhjubah}(h]h ]h"]h$]h&]uh1jMhjubeh}(h]h ]h"]h$]h&]uh1j7hhhKhjubah}(h]h ]h"]h$]h&]uh1j2hjhhhNhNubh)}(hGets a string descriptor from the device. The caller must fill in the "index" field to indicate which descriptor should be returned.h]hGets a string descriptor from the device. The caller must fill in the “index” field to indicate which descriptor should be returned.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj3)}(hhh]j8)}(hHIDIOCINITREPORT - (none) h](j>)}(hHIDIOCINITREPORTh]hHIDIOCINITREPORT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j=hhhKhjubjN)}(hhh]jY)}(hhh]j^)}(h(none) h]h)}(h(none)h]h(none)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j]hjubah}(h]h ]h"]h$]h&]j}j~uh1jXhhhKhjubah}(h]h ]h"]h$]h&]uh1jMhjubeh}(h]h ]h"]h$]h&]uh1j7hhhKhjubah}(h]h ]h"]h$]h&]uh1j2hjhhhNhNubh)}(hXjInstructs the kernel to retrieve all input and feature report values from the device. At this point, all the usage structures will contain current values for the device, and will maintain it as the device changes. Note that the use of this ioctl is unnecessary in general, since later kernels automatically initialize the reports from the device at attach time.h]hXjInstructs the kernel to retrieve all input and feature report values from the device. At this point, all the usage structures will contain current values for the device, and will maintain it as the device changes. Note that the use of this ioctl is unnecessary in general, since later kernels automatically initialize the reports from the device at attach time.}(hjKhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj3)}(hhh]j8)}(h'HIDIOCGNAME - string (variable length) h](j>)}(h HIDIOCGNAMEh]h HIDIOCGNAME}(hj`hhhNhNubah}(h]h ]h"]h$]h&]uh1j=hhhKhj\ubjN)}(hhh]jY)}(hhh]j^)}(hstring (variable length) h]h)}(hstring (variable length)h]hstring (variable length)}(hjxhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjtubah}(h]h ]h"]h$]h&]uh1j]hjqubah}(h]h ]h"]h$]h&]j}j~uh1jXhhhKhjnubah}(h]h ]h"]h$]h&]uh1jMhj\ubeh}(h]h ]h"]h$]h&]uh1j7hhhKhjYubah}(h]h ]h"]h$]h&]uh1j2hjhhhNhNubh)}(hGets the device nameh]hGets the device name}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj3)}(hhh]j8)}(h2HIDIOCGREPORT - struct hiddev_report_info (write) h](j>)}(h HIDIOCGREPORTh]h HIDIOCGREPORT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j=hhhKhjubjN)}(hhh]jY)}(hhh]j^)}(h"struct hiddev_report_info (write) h]h)}(h!struct hiddev_report_info (write)h]h!struct hiddev_report_info (write)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j]hjubah}(h]h ]h"]h$]h&]j}j~uh1jXhhhKhjubah}(h]h ]h"]h$]h&]uh1jMhjubeh}(h]h ]h"]h$]h&]uh1j7hhhKhjubah}(h]h ]h"]h$]h&]uh1j2hjhhhNhNubh)}(hInstructs the kernel to get a feature or input report from the device, in order to selectively update the usage structures (in contrast to INITREPORT).h]hInstructs the kernel to get a feature or input report from the device, in order to selectively update the usage structures (in contrast to INITREPORT).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj3)}(hhh]j8)}(h2HIDIOCSREPORT - struct hiddev_report_info (write) h](j>)}(h HIDIOCSREPORTh]h HIDIOCSREPORT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j=hhhKhjubjN)}(hhh]jY)}(hhh]j^)}(h"struct hiddev_report_info (write) h]h)}(h!struct hiddev_report_info (write)h]h!struct hiddev_report_info (write)}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj&ubah}(h]h ]h"]h$]h&]uh1j]hj#ubah}(h]h ]h"]h$]h&]j}j~uh1jXhhhKhj ubah}(h]h ]h"]h$]h&]uh1jMhjubeh}(h]h ]h"]h$]h&]uh1j7hhhKhj ubah}(h]h ]h"]h$]h&]uh1j2hjhhhNhNubh)}(hInstructs the kernel to send a report to the device. This report can be filled in by the user through HIDIOCSUSAGE calls (below) to fill in individual usage values in the report before sending the report in full to the device.h]hInstructs the kernel to send a report to the device. This report can be filled in by the user through HIDIOCSUSAGE calls (below) to fill in individual usage values in the report before sending the report in full to the device.}(hjVhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj3)}(hhh]j8)}(h;HIDIOCGREPORTINFO - struct hiddev_report_info (read/write) h](j>)}(hHIDIOCGREPORTINFOh]hHIDIOCGREPORTINFO}(hjkhhhNhNubah}(h]h ]h"]h$]h&]uh1j=hhhKhjgubjN)}(hhh]jY)}(hhh]j^)}(h'struct hiddev_report_info (read/write) h]h)}(h&struct hiddev_report_info (read/write)h]h&struct hiddev_report_info (read/write)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j]hj|ubah}(h]h ]h"]h$]h&]j}j~uh1jXhhhKhjyubah}(h]h ]h"]h$]h&]uh1jMhjgubeh}(h]h ]h"]h$]h&]uh1j7hhhKhjdubah}(h]h ]h"]h$]h&]uh1j2hjhhhNhNubh)}(hXFills in a hiddev_report_info structure for the user. The report is looked up by type (input, output or feature) and id, so these fields must be filled in by the user. The ID can be absolute -- the actual report id as reported by the device -- or relative -- HID_REPORT_ID_FIRST for the first report, and (HID_REPORT_ID_NEXT | report_id) for the next report after report_id. Without a priori information about report ids, the right way to use this ioctl is to use the relative IDs above to enumerate the valid IDs. The ioctl returns non-zero when there is no more next ID. The real report ID is filled into the returned hiddev_report_info structure.h]hXFills in a hiddev_report_info structure for the user. The report is looked up by type (input, output or feature) and id, so these fields must be filled in by the user. The ID can be absolute -- the actual report id as reported by the device -- or relative -- HID_REPORT_ID_FIRST for the first report, and (HID_REPORT_ID_NEXT | report_id) for the next report after report_id. Without a priori information about report ids, the right way to use this ioctl is to use the relative IDs above to enumerate the valid IDs. The ioctl returns non-zero when there is no more next ID. The real report ID is filled into the returned hiddev_report_info structure.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj3)}(hhh]j8)}(h9HIDIOCGFIELDINFO - struct hiddev_field_info (read/write) h](j>)}(hHIDIOCGFIELDINFOh]hHIDIOCGFIELDINFO}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j=hhhKhjubjN)}(hhh]jY)}(hhh]j^)}(h&struct hiddev_field_info (read/write) h]h)}(h%struct hiddev_field_info (read/write)h]h%struct hiddev_field_info (read/write)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j]hjubah}(h]h ]h"]h$]h&]j}j~uh1jXhhhKhjubah}(h]h ]h"]h$]h&]uh1jMhjubeh}(h]h ]h"]h$]h&]uh1j7hhhKhjubah}(h]h ]h"]h$]h&]uh1j2hjhhhNhNubh)}(hX3Returns the field information associated with a report in a hiddev_field_info structure. The user must fill in report_id and report_type in this structure, as above. The field_index should also be filled in, which should be a number from 0 and maxfield-1, as returned from a previous HIDIOCGREPORTINFO call.h]hX3Returns the field information associated with a report in a hiddev_field_info structure. The user must fill in report_id and report_type in this structure, as above. The field_index should also be filled in, which should be a number from 0 and maxfield-1, as returned from a previous HIDIOCGREPORTINFO call.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj3)}(hhh]j8)}(h4HIDIOCGUCODE - struct hiddev_usage_ref (read/write) h](j>)}(h HIDIOCGUCODEh]h HIDIOCGUCODE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j=hhhKhjubjN)}(hhh]jY)}(hhh]j^)}(h%struct hiddev_usage_ref (read/write) h]h)}(h$struct hiddev_usage_ref (read/write)h]h$struct hiddev_usage_ref (read/write)}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj1ubah}(h]h ]h"]h$]h&]uh1j]hj.ubah}(h]h ]h"]h$]h&]j}j~uh1jXhhhKhj+ubah}(h]h ]h"]h$]h&]uh1jMhjubeh}(h]h ]h"]h$]h&]uh1j7hhhKhjubah}(h]h ]h"]h$]h&]uh1j2hjhhhNhNubh)}(hReturns the usage_code in a hiddev_usage_ref structure, given that its report type, report id, field index, and index within the field have already been filled into the structure.h]hReturns the usage_code in a hiddev_usage_ref structure, given that its report type, report id, field index, and index within the field have already been filled into the structure.}(hjahhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj3)}(hhh]j8)}(h4HIDIOCGUSAGE - struct hiddev_usage_ref (read/write) h](j>)}(h HIDIOCGUSAGEh]h HIDIOCGUSAGE}(hjvhhhNhNubah}(h]h ]h"]h$]h&]uh1j=hhhKhjrubjN)}(hhh]jY)}(hhh]j^)}(h%struct hiddev_usage_ref (read/write) h]h)}(h$struct hiddev_usage_ref (read/write)h]h$struct hiddev_usage_ref (read/write)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j]hjubah}(h]h ]h"]h$]h&]j}j~uh1jXhhhKhjubah}(h]h ]h"]h$]h&]uh1jMhjrubeh}(h]h ]h"]h$]h&]uh1j7hhhKhjoubah}(h]h ]h"]h$]h&]uh1j2hjhhhNhNubh)}(hXdReturns the value of a usage in a hiddev_usage_ref structure. The usage to be retrieved can be specified as above, or the user can choose to fill in the report_type field and specify the report_id as HID_REPORT_ID_UNKNOWN. In this case, the hiddev_usage_ref will be filled in with the report and field information associated with this usage if it is found.h]hXdReturns the value of a usage in a hiddev_usage_ref structure. The usage to be retrieved can be specified as above, or the user can choose to fill in the report_type field and specify the report_id as HID_REPORT_ID_UNKNOWN. In this case, the hiddev_usage_ref will be filled in with the report and field information associated with this usage if it is found.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj3)}(hhh]j8)}(h/HIDIOCSUSAGE - struct hiddev_usage_ref (write) h](j>)}(h HIDIOCSUSAGEh]h HIDIOCSUSAGE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j=hhhKhjubjN)}(hhh]jY)}(hhh]j^)}(h struct hiddev_usage_ref (write) h]h)}(hstruct hiddev_usage_ref (write)h]hstruct hiddev_usage_ref (write)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j]hjubah}(h]h ]h"]h$]h&]j}j~uh1jXhhhKhjubah}(h]h ]h"]h$]h&]uh1jMhjubeh}(h]h ]h"]h$]h&]uh1j7hhhKhjubah}(h]h ]h"]h$]h&]uh1j2hjhhhNhNubh)}(hSets the value of a usage in an output report. The user fills in the hiddev_usage_ref structure as above, but additionally fills in the value field.h]hSets the value of a usage in an output report. The user fills in the hiddev_usage_ref structure as above, but additionally fills in the value field.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj3)}(hhh]j8)}(h8HIDIOGCOLLECTIONINDEX - struct hiddev_usage_ref (write) h](j>)}(hHIDIOGCOLLECTIONINDEXh]hHIDIOGCOLLECTIONINDEX}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1j=hhhKhj$ubjN)}(hhh]jY)}(hhh]j^)}(h struct hiddev_usage_ref (write) h]h)}(hstruct hiddev_usage_ref (write)h]hstruct hiddev_usage_ref (write)}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj<ubah}(h]h ]h"]h$]h&]uh1j]hj9ubah}(h]h ]h"]h$]h&]j}j~uh1jXhhhKhj6ubah}(h]h ]h"]h$]h&]uh1jMhj$ubeh}(h]h ]h"]h$]h&]uh1j7hhhKhj!ubah}(h]h ]h"]h$]h&]uh1j2hjhhhNhNubh)}(h{Returns the collection index associated with this usage. This indicates where in the collection hierarchy this usage sits.h]h{Returns the collection index associated with this usage. This indicates where in the collection hierarchy this usage sits.}(hjlhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj3)}(hhh](j8)}(hHIDIOCGFLAG - int (read)h](j>)}(h HIDIOCGFLAGh]h HIDIOCGFLAG}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j=hhhKhj}ubjN)}(hhh]jY)}(hhh]j^)}(h int (read)h]h)}(hjh]h int (read)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j]hjubah}(h]h ]h"]h$]h&]j}j~uh1jXhhhKhjubah}(h]h ]h"]h$]h&]uh1jMhj}ubeh}(h]h ]h"]h$]h&]uh1j7hhhKhjzubj8)}(hHIDIOCSFLAG - int (write) h](j>)}(h HIDIOCSFLAGh]h HIDIOCSFLAG}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j=hhhKhjubjN)}(hhh]jY)}(hhh]j^)}(h int (write) h]h)}(h int (write)h]h int (write)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j]hjubah}(h]h ]h"]h$]h&]j}j~uh1jXhhhKhjubah}(h]h ]h"]h$]h&]uh1jMhjubeh}(h]h ]h"]h$]h&]uh1j7hhhKhjzhhubeh}(h]h ]h"]h$]h&]uh1j2hjhhhNhNubh)}(hThese operations respectively inspect and replace the mode flags that influence the read() call above. The flags are as follows:h]hThese operations respectively inspect and replace the mode flags that influence the read() call above. The flags are as follows:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubjS)}(hXHIDDEV_FLAG_UREF - read() calls will now return struct hiddev_usage_ref instead of struct hiddev_event. This is a larger structure, but in situations where the device has more than one usage in its reports with the same usage code, this mode serves to resolve such ambiguity. HIDDEV_FLAG_REPORT - This flag can only be used in conjunction with HIDDEV_FLAG_UREF. With this flag set, when the device sends a report, a struct hiddev_usage_ref will be returned to read() filled in with the report_type and report_id, but with field_index set to FIELD_INDEX_NONE. This serves as additional notification when the device has sent a report.h]j3)}(hhh](j8)}(hXHIDDEV_FLAG_UREF - read() calls will now return struct hiddev_usage_ref instead of struct hiddev_event. This is a larger structure, but in situations where the device has more than one usage in its reports with the same usage code, this mode serves to resolve such ambiguity. h](j>)}(hHIDDEV_FLAG_UREFh]hHIDDEV_FLAG_UREF}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j=hhhKhjubjN)}(hhh]jY)}(hhh]j^)}(hXread() calls will now return struct hiddev_usage_ref instead of struct hiddev_event. This is a larger structure, but in situations where the device has more than one usage in its reports with the same usage code, this mode serves to resolve such ambiguity. h]h)}(hXread() calls will now return struct hiddev_usage_ref instead of struct hiddev_event. This is a larger structure, but in situations where the device has more than one usage in its reports with the same usage code, this mode serves to resolve such ambiguity.h]hXread() calls will now return struct hiddev_usage_ref instead of struct hiddev_event. This is a larger structure, but in situations where the device has more than one usage in its reports with the same usage code, this mode serves to resolve such ambiguity.}(hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj3ubah}(h]h ]h"]h$]h&]uh1j]hj0ubah}(h]h ]h"]h$]h&]j}j~uh1jXhhhKhj-ubah}(h]h ]h"]h$]h&]uh1jMhjubeh}(h]h ]h"]h$]h&]uh1j7hhhKhjubj8)}(hXpHIDDEV_FLAG_REPORT - This flag can only be used in conjunction with HIDDEV_FLAG_UREF. With this flag set, when the device sends a report, a struct hiddev_usage_ref will be returned to read() filled in with the report_type and report_id, but with field_index set to FIELD_INDEX_NONE. This serves as additional notification when the device has sent a report.h](j>)}(hHIDDEV_FLAG_REPORTh]hHIDDEV_FLAG_REPORT}(hjahhhNhNubah}(h]h ]h"]h$]h&]uh1j=hhhKhj]ubjN)}(hhh]jY)}(hhh]j^)}(hXQThis flag can only be used in conjunction with HIDDEV_FLAG_UREF. With this flag set, when the device sends a report, a struct hiddev_usage_ref will be returned to read() filled in with the report_type and report_id, but with field_index set to FIELD_INDEX_NONE. This serves as additional notification when the device has sent a report.h]h)}(hXQThis flag can only be used in conjunction with HIDDEV_FLAG_UREF. With this flag set, when the device sends a report, a struct hiddev_usage_ref will be returned to read() filled in with the report_type and report_id, but with field_index set to FIELD_INDEX_NONE. This serves as additional notification when the device has sent a report.h]hXQThis flag can only be used in conjunction with HIDDEV_FLAG_UREF. With this flag set, when the device sends a report, a struct hiddev_usage_ref will be returned to read() filled in with the report_type and report_id, but with field_index set to FIELD_INDEX_NONE. This serves as additional notification when the device has sent a report.}(hjyhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjuubah}(h]h ]h"]h$]h&]uh1j]hjrubah}(h]h ]h"]h$]h&]j}j~uh1jXhhhKhjoubah}(h]h ]h"]h$]h&]uh1jMhj]ubeh}(h]h ]h"]h$]h&]uh1j7hhhKhjubeh}(h]h ]h"]h$]h&]uh1j2hjubah}(h]h ]h"]h$]h&]uh1jRhhhKhjhhubeh}(h]ioctlah ]h"]ioctl():ah$]h&]uh1hhjmhhhhhKgubeh}(h]the-hiddev-apiah ]h"]the hiddev apiah$]h&]uh1hhhhhhhhKAubeh}(h]0care-and-feeding-of-your-human-interface-devicesah ]h"]0care and feeding of your human interface devicesah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerjerror_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}(jjjjjjjgjjjj jju nametypes}(jjjjjjjuh}(jhjhjgjjjmj jjju footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages] transformerN include_log] decorationNhhub.