Subject: Re: howto capture events generated by uhid(4) devices
To: Berndt Josef Wulf <wulf@ping.net.au>
From: Greg Troxel <gdt@ir.bbn.com>
List: port-i386
Date: 12/17/2006 21:02:20
  From my understanding, usbhidaction(8) is used to associate an
  usbhid event with the execution of a command. I can't see how this
  will work from within an application.

  usbhid(3) provides routines that simplify access to usbhid
  devices. AFAICT it doesn't provide event notification.

Read the sources to usbhidaction, because it's able to do things
triggered on events.  Rather than execing a program, you want it to
call a procedure.  The program seems to simply read from the file
descriptor obtained by opening e.g. /dev/uhid0.  You'll need to wrap
this into select.  Probably the driver only returns full reports
atomically; this could be a bit messy but I bet won't cause you
trouble.

(This isn't i386-specific, really.)

-- 
    Greg Troxel <gdt@ir.bbn.com>