[patch] add keymap data to make random laptop vendor keys work

Lennart Poettering mzuny at 0pointer.de
Tue May 8 14:10:38 PDT 2007


On Tue, 08.05.07 09:39, Richard Hughes (hughsient at gmail.com) wrote:

> > > - Uses KDSETKEYCODE/setkeycodes on the console which is evil. Should
> > >   be using EVIOCSKEYCODE on the input device.
> > 
> > Sure. That's fixable.
> 
> How do we know which input device is the hardware keyboard - is it
> always event1?

It's not. There's /proc/bus/input/devices for that.

> I guess it might even be better to match against the keyboard device -
> rather than the computer device, something like:
> 
>     <match key="info.category" string="input">
>       <match key="info.product" string="AT Translated Set 2 keyboard">
>         <match key="/org/freedesktop/Hal/devices/computer:system.hardware.vendor" string="LENOVO">
>           <match key="/org/freedesktop/Hal/devices/computer:smbios.system.version" contains="3000">
>             <append key="keymap.linux.data" type="strlist">e016:238</append>	<!-- Fn+F5	Wireless -->
>             <append key="keymap.linux.data" type="strlist">e017:142</append>	<!-- Fn+F4	Suspend -->
>             <append key="keymap.linux.data" type="strlist">e018:205</append>	<!-- Fn+F12	Hibernate -->
>           </match>
>         </match>
>       </match>
>     </match>

Please don't use numeric keys. The Linux keytable is already almost
depleted, there's not much space left (according to Dmitry Torokhov),
hence they're now registering new keys only very seldomley. Using numeric
ids won't be future-proof. Textual strings are quite a bit more future-proof.

keyfuzz uses textual strings. If you really think you shuld go ahead
with doing this stuff from HAL you might want to copy that part from
keyfuzz since it uses gperf to generate a perfect hash function for
looking up those keys using GNU gperf in O(1):

http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/Makefile.am?rev=19&root=keyfuzz&view=auto

> > Yeah. Because no-one uses HAL _anyway_.
> 
> Heh, HAL is even in the GMAE stack...

Is it? As I read http://www.gnome.org/mobile/ it's only "under
consideration". 

But anway. 

Lennart

-- 
Lennart Poettering                                         Red Hat, Inc.
lennart [at] poettering [dot] net                          ICQ# 11060553
http://0pointer.net/lennart/                            GnuPG 0x1A015CC4


More information about the hal mailing list