KubuntuLaptopKeycodes

Revision 16 as of 2006-09-03 16:33:15

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

Dell Latitude D600 BR ["Allee"]

Acer Travelmate 8100 BR ['JoolsSmyth']

Dell Inspiron 6400 BR ["FranciscoBorges"]

Sleep

223 / sleep

223 /sleep

sleep

sleep

Hibernate

165 / hibernate

165

Battery/Power modes

241 / battery

241

241

241 / battery.voltage.current [2]

Info

245 / info

n/a

Presentation

205 / presentation

n/a

n/a

Mute

160 / mute

160

160

160 / mute

160

160

160 / mute

Volume Down

174 / volumedown

174

174 / volumedown

174

174

174 / volumedown

Volume Up

176 / volumeup

176

176 / volumeup

176

176

176 / volumeup

Play/Pause

162

Next Track

153

Previous Track

144

Stop

164

Lock screen

146

n/a

Wifi

no keycode

add bluetoothUSB dev. [1]

SwitchMonitor

?

170

Eject CDROM

no keycode

204

Brightness up

212

no keycode

212

Brightness Down

no keycode

239

101

[http://en.wikipedia.org/wiki/SysRq SysRq]

no keycode

[http://en.wikipedia.org/wiki/Break_key Break]

no keycode

[http://en.wikipedia.org/wiki/Scroll_lock Scroll Lk]

78

Travelmate 8100 Note: I have a wireless button. To get it to work I had to first edit the hotkeys-setup (/usr/share/hotkeys-setup/acer.hk) and add the lines

{{{setkeycodes e055 $KEY_F13 # Orange Wireless On (hardware, led, informational only) setkeycodes e056 $KEY_F14 # Orange Wireless Off (hardware, led, informational only)}}}

then I could set up the keycodes in X with xmodmap to ifup/ifdown the wlan.

{{{keycode 182 = XF86User1KB keycode 183 = XF86User2KB}}}

Would be nice if these buttons could be used "out of the box". Although perhaps to leave it to the user in kde as to how they manage the actual buttons

Dell Inspiron 6400 Notes:

  • [1]:Wifi key behavior is configurable at the BIOS.
  • [2]:It takes a while and then it prints:

acpi_BAT0 property battery.voltage.current = 12562 (0x3112)

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 }}}