This is a temporary webpage for libhid, a user-space HID access library written in C. It provides a generic and flexible way to access and interact with USB HID devices, much like libusb does for plain USB devices. It is based on libusb, thus it requires no HID support in the kernel. Furthermore, it aims to support all operating system supported by libusb: Linux, BSD, OS X, and Windows.
libhid is still under development and it does not have a proper homepage (if you want to write one, please contact us!). Until one is ready, you are welcome to download the software and try it out, it should be easy to use if you have some knowledge of C and are willing to read someone else's code. Documentation does not yet exist, but we are working to provide it using Doxygen (again, if you want to help, please contact us!).
For a simple example on how to use libhid, please check out test_libhid.c.
For more information, please consult the README.
Development of libhid is currently coordinated with mailing lists and Subversion (see further down). The following three mailing lists exist (click on the list name to go to the list information page):
We realise that the documentation and instructions we provide with the library are far from usable. Thus, please do not hesitate to write to us on the discussion list!
libhid is available through various ways. In the following, we list the possibilities in decreasing order of preference/currency:
The Subversion tree will be the preferred development repository from here forward. The CVS version history is available in the Subversion repository as well.
Update (2006-06-29): The SVN repository has moved again. We are now back at Alioth. (Many thanks to Martin Krafft for hosting libhid for these past two years.) If you have a checked out copy, please relocate it. If you have read-only access, use the first command. With write access, use the second:
svn sw --relocate svn://svn.{ailab.ch,debian.org}/svn/libhid/trunk
svn sw --relocate svn+ssh://svn.{ailab.ch/home/svn/external,debian.org/svn}/libhid/trunk
To check out the latest version of libhid into the directory libhid-svn, ensure that Subversion is installed, and use the following command:
svn co svn://svn.debian.org/libhid/trunk libhid-svn
Instructions on how to compile the code are available in the README file. Please do not hesitate to write to the mailing list if you have questions, comments, or problems.
The Subversion tree can also be viewed online via websvn. The latest version is available at the trunk.
If you want to contribute, please send a patch or two. We cannot give out write access to the Subversion tree just like that, but if you show us a patch, we'll conclude that you are serious about developing libhid, and give you permission. You will need an account on Alioth. You can sign up for free (and need not be affiliated with Debian).
The CVS tree contains all changes to libhid through October 2004. You can check it out in read-only mode with the following commands (the password is empty, so just hit enter when prompted):
cvs -d :pserver:anoncvs@cvs.ailab.ch:/home/cvs/external login
cvs -z3 -d :pserver:anoncvs@cvs.ailab.ch:/home/cvs/external co libhid
libhid is in Debian, and was included in sarge (3.1). To install:
# apt-get install libhid-dev python-hid
$ ./configure && make
$ su
# make install
to install it into /usr/local. You may wish to add "--disable-swig" to the configure command line if you do not have both SWIG and the Python development headers installed.
At time of writing, libhid can be used directly from C/C++, or from Python. It is possible for us to provide further language bindings, thanks to Swig. Thus, if you need to use HID devices from any other of the languages supported by Swig, it should be trivial to add support. Just echo your desires to the discussion list, but bear in mind that the libhid developers cannot guarantee support for any given language.
For a simple example on how to use libhid from Python, please check out this script.
libhid is released under the terms of the GPL version 2.
We realise that this is a serious impediment. The GPL is a "viral" licence, and you will only be able to use libhid in other GPL projects. We would like to change the licence, but libhid uses the MGE UPS SYSTEMS HID Parser, which is GPL, and thus we cannot. Our solution is to rewrite the HID parser. One of these days. We are also in contact with MGE, trying to convince them to loosen their licence. If the licencing issues are solved, we are likely to re-release libhid under the Artistic Licence.
libhid grew out of libHID and is actively being developed by
It is used in a rewrite of the Network UPS Tools USB driver (newhidups) and as a basis for libphidgets.
$Id: index.html 300 2006-06-30 03:11:26Z clepple-guest $