mapping single-key input devices to buttons

Johannes Berg johannes at sipsolutions.net
Mon May 1 09:10:22 PDT 2006


On Mon, 2006-05-01 at 16:56 +0100, Matthew Garrett wrote:

> In some cases, these single-button "keyboard" devices are actually 
> implemented as, well, keyboards with one key. 

Yeah, that's true.

> 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.

Yes, some hardware might even show up that has all the buttons on a
single usb keyboard or something. Who knows.

> 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.

As just discussed on IRC it is already readable, so it's just a matter
of having the driver query it on initialisation and send the right event
once.

Hence it should be doable. The question is how we handle that. How about
making the button type a stringlist instead, and allowing a single
keyboard thingie to have multiple buttons? Then for those where we care,
we can add all the ones like
button.type = ['lid-switch', ...]
and
button.lid-switch.has_state = True
and
button.lid-switch.state = True
(for the case where booting with lid closed)

Comments?

johannes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 793 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/hal/attachments/20060501/1080834f/attachment.pgp


More information about the hal mailing list