KubuntuLaptopKeycodes

Revision 9 as of 2006-07-30 13:28:10

Clear message

Keycode/hal events for laptop keys

I am working on KubuntuLaptopButtons spec for Edgy and would like to get more reports on keycodes and HAL events from laptop users.

Please add your notebook (with your nick) to this table - if you have a key which is not listed yet, please add new row. If you get report, put it into table in following format: keycode / event:

Key

HP nw8240 BR LukaRenko

Toshiba A10 Satellite BR ["Hobbsee"]

Maxdata ECO4500A BR ["Hugelmopf"]

Prestigio Visconte 1200 BR JindrichPozlovsky

Sleep

223 / sleep

223

sleep

Hibernate

165

Battery/Power modes

241 / battery

241

Info

245 / info

Presentation

205 / presentation

Mute

160 / mute

160

160

160 / mute

Volume Down

174 / volumedown

174

174 / volumedown

Volume Up

176 / volumeup

176

176 / volumeup

Lock screen

146

How to get keycode

You can get keycode by running xev program from command line (terminal/Konsole) and then pressing the special laptop keys and searching for keycode, for example output:

KeyPress event, serial 28, synthetic NO, window 0x5000001,
    root 0x76, subw 0x0, time 1400690129, (70,50), root:(74,102),
    state 0x0, keycode 223 (keysym 0x1008ff10, XF86Standby), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 28, synthetic NO, window 0x5000001,
    root 0x76, subw 0x0, time 1400690129, (70,50), root:(74,102),
    state 0x0, keycode 223 (keysym 0x1008ff10, XF86Standby), same_screen YES,
    XLookupString gives 0 bytes:

An easier way to do this is to run:

xev | grep -A2 --line-buffered '^KeyRelease' | sed -n '/keycode /s/^.*keycode \([0-9]*\).* (.*, \(.*\)).*$/\1 \2/p'

This will only output pressed keycode and currently assigned keysym, for example:

160 XF86AudioMute
174 XF86AudioLowerVolume
176 XF86AudioRaiseVolume

How to get HAL events

You can get HAL events by running lshal -m program from command line (terminal/Konsole) and the pressing special laptop keys which will generate output like this: {{{Start monitoring devicelist:


platform_i8042_i8042_Kbd_Port_logicaldev_input condition ButtonPressed = sleep platform_i8042_i8042_Kbd_Port_logicaldev_input condition ButtonPressed = battery platform_i8042_i8042_Kbd_Port_logicaldev_input condition ButtonPressed = help platform_i8042_i8042_Kbd_Port_logicaldev_input condition ButtonPressed = presentation platform_i8042_i8042_Kbd_Port_logicaldev_input condition ButtonPressed = mute platform_i8042_i8042_Kbd_Port_logicaldev_input condition ButtonPressed = volumedown platform_i8042_i8042_Kbd_Port_logicaldev_input condition ButtonPressed = volumeup }}}