How to map keys which emit keycodes ?

Richard Hughes hughsient at gmail.com
Mon Nov 19 12:08:17 PST 2007


On Fri, 2007-11-16 at 00:22 +0000, Carlos Corbacho wrote:
> (CC'ing Danny and Richard explicitly as I'd like a second opinion on an idea 
> to handle this)

Cheers.

> On Wednesday 14 November 2007 15:40:29 Rohan Dhruva wrote:
> > I'm using fedora 8. I had submitted the xml patch for my keyboard -
> > Acer TravelMate 3260.
> > http://gitweb.freedesktop.org/?p=hal-info.git;a=blob;f=fdi/information/10fr
> >eedesktop/30-keymap-acer.fdi#l151
> >
> > Now in my keyboard there is a strange oddity - the Fn + Right
> > (brightness increase) arrow emits a atkbd.c dmesg error, which is
> > handled by hal-info. However, the Fn + Left (brightness decrease) key
> > does not give any atkbd.c error, but rather maps in to a keycode
> > properly - 239 (as shown by xev).
> > Now the problem is, since brightness up key is already mapped, I get
> > an on screen indicator whenever I increase the brightness. Just for
> > curiosity and perfection sake (hehe ;) ) I want a similar indicator
> > when I press the brightness down key combo too. Is there some way to
> > map those keys in HAL which emit keycodes, too (but not keysyms) ?
> 
> [To summarise - the 'brightness up' key on Rohan's laptop is explicitly mapped 
> by HAL to KEY_BRIGHTNESSUP, but the 'brightness down' key is mapped by the 
> kernel to a different keycode that is not KEY_BRIGHTNESSDOWN].

Then we need to fix it to KEY_BRIGHTNESSDOWN - the quirks framework was
partially designed for that by not checking explicitly for KEY_UNKNOWN.

> We could add a new key entry to the HAL info mapping for these laptops to 
> remap the scancode for the brightness down key to the 'correct' 
> KEY_BRIGHTNESSDOWN keycode (since the kernel is obviously getting this 
> wrong).

Yes.

> This goes a bit beyond just mapping unknown scancodes, though I don't think 
> remapping broken/ wrong keycode mappings is much of a stretch - but I'd like 
> a second opinion.

Yes, we need to do this.

Richard.




More information about the hal mailing list