mapping single-key input devices to buttons

Matthew Garrett mjg59 at srcf.ucam.org
Mon May 1 08:56:26 PDT 2006


On Mon, May 01, 2006 at 11:38:22AM -0400, David Zeuthen wrote:

> [2] : What's the right fix? Personally I think, for Linux, that there
> ought to be some kind of sysfs class 'button' or something. It's just
> not a keyboard since some buttons can indeed have states (like the lid
> button). I'm alright though with using an input device as the
> notification mechanism... but I don't really know..

In some cases, these single-button "keyboard" devices are actually 
implemented as, well, keyboards with one key. Where the hardware claims 
that something is a USB keyboard, I think trying to optimise for the 
single-key case and exporting that separately is less than ideal.

My recollection is that the event interface allows you to read the state 
a key currently has. If not, it's just a matter of adding an ioctl to do 
it - the state mask really should be visible to userspace.
-- 
Matthew Garrett | mjg59 at srcf.ucam.org


More information about the hal mailing list