Xorg USB HID driver

xf86-input-usbhid is a *BSD-specific Xorg driver for a number of USB Human Interface Devices such as graphics tablets, touch screens and mice.

This driver has been tested on multiple cheap USB mice and one graphics tablet. Because of that, and since USB HID hardware tends to come up with creative ways of (ab)using the protocol, there's a high chance that your particular piece of equipment is not yet supported. You have been warned.

The driver is known to work with xorg-server 1.12 and 1.17. It may or may not work with other server versions.

How to use it

You can get driver's latest sources at [1], and read the man page at [2].

In a nutshell, to use it you first need to install Xorg, then fetch, build and install the driver like this:

hg clone http://hg.tx97.net/xf86-input-usbhid
cd xf86-input-usbhid
./autogen.sh
./configure
make install

Then add at least this snippet to your xorg.conf:

Section "ServerLayout"
    ...
    InputDevice "HID0"
    ...
EndSection

Section "InputDevice"
    Identifier "HID0"
    Driver "usbhid"
    Option "Device" "/dev/uhid0"
EndSection

Don't forget to read the man page at [2]; some devices do need extra tuning.

Finally, (re)start your Xorg server. Note that you need to start Xorg with the device already plugged in.

Alternatively to the configuration above, you can use a hotplug system like HAL to dynamically load the driver and create the device. Search for Section "InputClass" in xorg.conf man page to learn how to specify options in this case.

Other drivers

While you can use this driver for USB mice, those will likely work out of the box with ums(4) and moused(8).

Also take a look at similar work by Alexander Motin [3].

References

  1. http://hg.tx97.net/xf86-input-usbhid/
  2. http://manweb.tx97.net/http://tx97.net/xf86-input-usbhid/usbhiddrv.4
  3. http://lists.freebsd.org/pipermail/freebsd-hardware/2011-July/006749.html