Bug 169242

Summary: Multimedia keys not recognized event though correct layout is selected (Dell Latitude series laptop)
Product: [Applications] systemsettings Reporter: MartinG <gronslet>
Component: generalAssignee: Unassigned bugs mailing-list <unassigned-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: kde, peerit
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description MartinG 2008-08-16 16:47:34 UTC
Version:            (using KDE 4.1.0)
Installed from:    Fedora RPMs
OS:                Linux

I was delighted to see that in KDE 4 systemsettings/Regional and language/keyboard layout, finally, Dell Latitude series was listed. But it doesn't seem to include the brightness keys (no printout when using "xev").
Also, the volume keys doesn't do anything, although they do produce events (in "xev"). Do I still have to manually make them report "XF86AudioRaiseVolume" etc?

Since Fedora Core 4, I have manually altered /etc/sysconfig/keyboard and /etc/X11/Xmodmap to make X recognize eg. my volume keys (see below).

I would be happy to extend or add a new keyboard layout that could be included in systemsettings if someone could tell me how. 

regards,
MartinG

-----------------------------------------

In “/etc/sysconfig/keyboard“, add the following: 
# The '122' doesn't seem to matter - another keycode will be assigned
# See also/usr/src/linux/include/linux/input.h
# Screen brightness keys: do nothing (prevent extraneous kernel logs)
/usr/bin/setkeycodes e005 122
/usr/bin/setkeycodes e006 122
# Battery key
/usr/bin/setkeycodes e007 122
# Wireless on/off key: do nothing (prevent extraneous kernel logs)
/usr/bin/setkeycodes e008 122
# Eject media key:
/usr/bin/setkeycodes e009 122
# Dell Latitude X1 "Fn-F1/Hibernate" button:
/usr/bin/setkeycodes e00a 123

In “/etc/X11/Xmodmap” add this: 
! See also /usr/lib/X11/XKeysymDB
! See also /etc/X11/xkb/symbols/inet
keycode 160 = XF86AudioMute
keycode 174 = XF86AudioLowerVolume
keycode 176 = XF86AudioRaiseVolume
keycode 162 = XF86AudioPlay
keycode 144 = XF86AudioPrev
keycode 153 = XF86AudioNext
keycode 164 = XF86AudioStop
! Stand by button Fn-ESC
!keycode xxx = XF86Sleep
! Hibernate button Fn-F1
!keycode 165 = F30
! Wireless button (Wi-Fi button) Fn-F2
keycode 172 = F32
! Battery button Fn-F3
!keycode 171 = F33
keycode 129 = F33
! CRT/LCD button Fn-F8
keycode 231 = XF86Video
! Eject button Fn-F10
keycode 173 = XF86Eject
! Increase Brightness Fn-UpArrow
keycode 168 = XF86BrightnessAdjust
! Decrease Brightness Fn-DownArrow
keycode 169 = XF86BrightnessAdjust

! Make the windows key work
! (works out of the box in FC6. No, not with Norwegian layout and nodeadkeys):
add mod4 = Super_L

The last line should also make the windows key (winkey) working.
Comment 1 Jack Black 2008-08-27 13:52:30 UTC
The problem with my KDE 4.1 and the media keys on my keyboard was that alle the XF86Audio* were declared twice as I saw in "xmodmap -pk | grep -i audio" output:

159         0x1008ff14 (XF86AudioPlay)      0x1008ff31 (XF86AudioPause)                                  
160         0x1008ff12 (XF86AudioMute)                                                                   
161         0x1008ff1d (XF86Calculator)                                                                  
    162         0x1008ff31 (XF86AudioPause)                                                                  
    163                                                                                                      
    164         0x1008ff16 (XF86AudioPrev)                                                                   
    165                                                                                                      
    166         0x1008ff12 (XF86AudioMute) 

This is just an extract. Like you can see AudioMute is set twice but KDE recognizes only the first value. I know that because my key for mute has the code 160 and the keys on my keayboard vor volume up/down have the latter/higher codes and so are not functional.
Comment 2 MartinG 2008-08-28 14:55:06 UTC
FWIW, this is what I get:
$ xmodmap -pk | grep -i audio
    144         0x1008ff16 (XF86AudioPrev)
    153         0x1008ff17 (XF86AudioNext)
    160         0x1008ff12 (XF86AudioMute)
    162         0x1008ff14 (XF86AudioPlay)      0x1008ff31 (XF86AudioPause)
    164         0x1008ff15 (XF86AudioStop)      0x1008ff2c (XF86Eject)
    174         0x1008ff11 (XF86AudioLowerVolume)
    176         0x1008ff13 (XF86AudioRaiseVolume)
Comment 3 MartinG 2008-09-17 11:06:47 UTC
Just to add to the above, I sometimes have to "kickstart" the Win-key by running
"setxkbmap -option 'win:meta'" in an terminal (as normal user).
Comment 4 Jack Black 2009-01-14 21:40:58 UTC
Works for me now in KDE 4.1.96.
Comment 5 Michael Jansen 2009-02-17 00:54:47 UTC
MartinG ? Does it work for you too? If yes please close this bug.
Comment 6 MartinG 2009-02-17 12:01:12 UTC
All special keys seems to work now: Volume up, volume down and mute (these also gives OSD info), brightness keys does not give OSD, but works as expected (as they always have), stand-by button works.

The hibernate button (Fn-F1) does nothing (I haven't configured it to do anything either), and the battery button (Fn-F3) does nothing, but I guess I could configure these.

None of the special keys report unrecognized keypresses (dmesg) anymore, so I guess this is fixed, therefore closing this bug. Thanks!

Note, however, that what I would really like to have, is a simple user friendly tool with which I could record and report all multimedia keys back to the KDE team, for easy inclusion in the next release. That way I, as a non-developer, could help other users get stuff to work out of the box with "new" hardware.
(The Dell Latitude X1 is old and outdated and is barely able to run KDE4 anyway, so I will probably have to buy a new laptop soon, and go through the multimedia key hassle all over)

This is using: 
kernel 2.6.28 (Linus git ede6f5aea054d3fb67c78857f7abdee602302043, newest suspend/resume working kernel for the X1)
kdelibs-4.2.0-11.fc11.i386