I have an usb keyboard with SLEEP, WAKE and POWER keys but no media keys. In Ubuntu 12.04 i used xmodmap to remap this keys as XF86AudioMute, XF86AudioLowerVolume and XF86AudioRaiseVolume.
This is how it was done:
.Xmodmap in user's home directory:
keycode 124 = XF86AudioRaiseVolume keycode 150 = XF86AudioMute keycode 151 = XF86AudioLowerVolume`
.xinitrc in user's home directory:
As far as i remember it was enough to use SLEEP, WAKE an POWER keys as media keys (Mute, Volume Down, Volume Up).
Now i have fresh install of Ubuntu 14.04 and this approach yields no result.
xev recognizes new mappings, but these keys still do not work as media keys.
Example of xev output for POWER key:
KeyRelease event, serial 78, synthetic NO, window 0x4000001, root 0x25d, subw 0x0, time 3802034, (1198,451), root:(1228,573), state 0x10, keycode 124 (keysym 0x1008ff13, XF86AudioRaiseVolume), same_screen YES, XKeysymToKeycode returns keycode: 123 XLookupString gives 0 bytes: XFilterEvent returns: False
I have tried different usb keyboard which does have media keys and they work as expected.
Example of xev output for "Volume Up" key on keyboard with media keys:
KeyRelease event, serial 79, synthetic NO, window 0x4000001, root 0x25d, subw 0x0, time 4268348, (810,191), root:(961,347), state 0x10, keycode 123 (keysym 0x1008ff13, XF86AudioRaiseVolume), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False
Clearly i don't understand something here and i'm asking for help.
P.S. I have disabled default functionality of SLEEP, WAKE and POWER keys by setting
org.gnome.settings-daemon.plugins.power.active = false org.gnome.settings-daemon.plugins.power.button-hibernate = nothing org.gnome.settings-daemon.plugins.power.button-power = nothing org.gnome.settings-daemon.plugins.power.button-sleep = nothing org.gnome.settings-daemon.plugins.power.button-suspend = nothing
P.P.S. My first move was to use Ubuntu's System settings. While it seems to have the ability to set other keys as media keys, it doesn't work, at least on my system.