How to map keys which emit keycodes ?

Carlos Corbacho carlos at strangeworlds.co.uk
Thu Nov 15 16:22:16 PST 2007


(CC'ing Danny and Richard explicitly as I'd like a second opinion on an idea 
to handle this)

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

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

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.

-Carlos
-- 
E-Mail: carlos at strangeworlds.co.uk
Web: strangeworlds.co.uk
GPG Key ID: 0x23EE722D


More information about the hal mailing list