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 this source file.
For more information, please consult the README.
Development of libhid is currently coordinated with mailing lists and CVS (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.
Important: The SVN repository has moved. 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.{debian.org,ailab.ch}/svn/libhid/trunk
svn sw --relocate svn+ssh://svn.{debian.org/svn,ailab.ch/home/svn/external}/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.ailab.ch/libhid/trunk libhid-svn
To retrieve a particular released (or otherwise tagged) version of libhid, simply modify the checkout URL. You may have to browse with viewcvs to find the exact tag name. As an example, let's retrieve version 0.2.8-1:
svn co svn://svn.ailab.ch/libhid/tags/0.2.8-1 libhid-0.2.8-1
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 viewcvs. 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.
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
In addition, the CVS tree can be viewed online.
libhid has entered Debian, but the versions may be a little behind. You can use my (madduck's) repository to always get the latest versions. Simply add the following to your /etc/apt/sources.list file:
deb http://debian.madduck.net ~madduck/packages/stage/libhid/
deb-src http://debian.madduck.net ~madduck/packages/stage/libhid/
and then install it. You may leave out python-hid if you do not want the Python bindings:
# apt-get install libhid-dev python-hid
The packages and the archive are signed. More information is available here.
Of course, libhid is available as a tarball from the Debian repository. Simply find the latest file with the extension .orig.tar.gz, download it, unpack it, and then do the standard
$ ./configure && make
$ su
# make install
to install it into /usr/local.
Note that there is currently a dependency on the Debian patch, which I have not yet fixed. To unpack the tarball, you thus need to get both, the .orig.tar.gz file and the latest, corresponding .diff.gz file. Then, do the following to unpack:
$ tar xfz libhid_0.2.14.orig.tar.gz
$ cd libhid-0.2.14
$ zcat ../libhid_0.2.14-1.diff.gz | patch -p1
$ ./configure
[...]
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, we will make it available. Just echo your desires to the discussion list.
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 236 2005-04-24 14:12:55Z clepple $