Keymap Quirk Debugger |
Back to the main keymap page
The ACPI layer (and other hardware) emits events that are usually handled by system daeons such as acpid and lineakd. This interface is broken and depricated, and we have a good framework in the kernel for key presses, INPUT. Using INPUT also allows us to use the existing frameworks and do all the policy and configuration using standard tools and standard frameworks.
Using INPUT allows us to remap keys using the setkeycode
ioctl.
This is a good thing as it lets us remap keys from KEY_FN_F4
to KEY_BRIGHTNESSUP
.
This allows stuff like gnome-power-manager, HAL and X11 do the right thing when
the button is pressed, rather than having to remap it by hand or editing config files.
We can match the laptop make and model into hal-info and automatically make the keys do the right thing. To do this we need to map from hardware events (virtual scancodes) into keycodes. The virtual scancodes are listed in the tables below.
All the entries should look something like:
<match key="input.product" string="Sony Vaio Keys"> <match key="/org/freedesktop/Hal/devices/computer:system.hardware.vendor" prefix="Sony"> <match key="/org/freedesktop/Hal/devices/computer:system.hardware.product" string="VGN-S1XP(GB)"> <append key="input.keymap.data" type="strlist">0x0d:mute</append> <!-- Fn+F2 mute --> <append key="input.keymap.data" type="strlist">0x0e:volumedown</append> <!-- Fn+F3 mixer down --> <append key="input.keymap.data" type="strlist">0x0f:volumeup</append> <!-- Fn+F4 mixer up --> <append key="input.keymap.data" type="strlist">0x10:brightnessdown</append> <!-- Fn+F5 brightness up --> <append key="input.keymap.data" type="strlist">0x11:brightnessup</append> <!-- Fn+F6 brightness down --> <append key="input.keymap.data" type="strlist">0x12:switchvideomode</append> <!-- Fn+F7 switch crt/lcd --> <append key="input.keymap.data" type="strlist">0x17:suspend</append> <!-- Fn+F12 hibernate --> <append key="info.capabilities" type="strlist">input.keymap</append> </match> </match> </match>
If you are using a thinkpad and you want to do driver matching you'll
need to install a very new kernel (2.6.23) with the updated thinkpad-acpi
driver.
Driver matching (using MSC_SCAN
) is needed when the ACPI event is propogated
through evdev but is unknown.
What if I want to test the driver now? You can find a working external kernel module snapshot (totally unsupported) here. |
You can see the existing thinkpad-acpi keymaps here and also see the scancode table here.
If you are using a new sony laptop and you want to do driver matching you'll
need to install a very new kernel (2.6.23) with the updated sony-laptop
driver.
What if I want to test the driver now? You can find a working external kernel module snapshot (totally unsupported) here. |
You can see the existing sony-laptop keymaps here and also see the scancode table here.
Back to the main keymap page