[libhid-discuss] Talking to an HID device from user account in Linux

Peter Stuge stuge-libhid at cdy.org
Tue Mar 31 04:47:44 UTC 2009


Ali Asad wrote:
> For example, you can connect a USB mouse (a HID device) without
> requiring root access or forcing the user to use udev rules.
> 
> How are user mode applications able to talk to such HID devices?
> Is that through some generic/universal HID device driver supported
> by the Linux kernal (say uhid)?

Correct. (Though I think uhid is BSD only.)


> If so how do user applications use this universal HID driver?

Via the Linux input layer. For keyboards that maps to stdin.


> This technique would be orthogonal to the approach of using libhid
> to create our own device driver, but I want to explore all options.

Then you could also look into hiddev and/or hidraw. They can be used
to communicate with HID devices at a higher level than USB.

CONFIG_HID_DEV /usr/src/linux/Documentation/usb/hiddev.txt
CONFIG_HIDRAW http://cateee.net/lkddb/web-lkddb/HIDRAW.html (brief)

hiddev may come with restrictions on which non-HID-class things your
device can do however - but still worth looking into.


//Peter



More information about the libhid-discuss mailing list