Description
HID is often used as a general purpose protocol, beyond what Human Interface Device might suggest. In USB and bluetooth peripherals, for example, HID is often used to configure sensitivity, macro keys, lighting and other options. The software that is used to tweak these options is often found in user space.
As is described by the widely used hidapi library, there are two options when accessing HID devices on Linux:
- Using a general-purpose USB library (in this case libusb) to open a USB node and writing directly to that node
- Opening a hidraw node and writing to that. Hidraw nodes are created by the kernel and include bluetooth HID devices in addition to USB HID devices. It also promises to incorporate more interfaces if they incorporate these HID specification.
For applications where HID devices with different hardware interfaces might be used, a hidraw backend makes more sense and offers a simpler implementation. Additionally, the access scope to the device is more limited from the perspective of a sandbox, as the program can't access other aspects of the device that aren't HID interfaces.
It would be nice to have, complementary to a general purpose USB portal (discussed in #559), a portal to access hidraw nodes. This issue is meant as a discussion as to how hidraw would fit into the various interfaces that are being designed, such as the aforementioned portal or the wayland protocol inputfd. Sadly, I don't have the time nor the skills to implement this portal, but I think it might be interesting to some of the developers here.