You are not logged in.

#1 2016-05-14 14:43:19

sherrellbc
Member
Registered: 2014-05-26
Posts: 112

Xmodmap [audio] key mappings not working

I have a daskeyboard with a few audio keys in the upper right-hand corner. I wanted to make their use to control audio but have been confused on the results I am getting.

I started by using showkey -k to export the keycodes associated with these keys with the following result

keycode 113 press
keycode 114 press
keycode 115 press
keycode 142 press
keycode 163 press
keycode 164 press
keycode 165 press

Then, per this wiki I installed xmodmap and exported the default keybindings to ~/.Xmodmap. However, the keycodes I was getting from the showkey utility were not matching that which was in this configuration file.

...
keycode 113 = Left NoSymbol Left
keycode 114 = Right NoSymbol Right
keycode 115 = End NoSymbol End
...

I actually modified keycode 114 in this configuration file to something other than "Right" and tested the changes . Sure enough, I could not longer navigate "Right", so I reverted the changes.  I had read earlier of an alternative for exporting the keycodes called xev, so I tried that. This time the resulting keys appeared to match with the Xmodmap configuration file.

Output of xev

KeyRelease event, serial 34, synthetic NO, window 0x1e00001,
    root 0x2ab, subw 0x0, time 3453466, (89,827), root:(3293,843),
    state 0x10, keycode 122 (keysym 0x1008ff11, XF86AudioLowerVolume), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyPress event, serial 34, synthetic NO, window 0x1e00001,
    root 0x2ab, subw 0x0, time 3453754, (89,827), root:(3293,843),
    state 0x10, keycode 123 (keysym 0x1008ff13, XF86AudioRaiseVolume), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

Configuration file

keycode 122 = XF86AudioLowerVolume NoSymbol XF86AudioLowerVolume
keycode 123 = XF86AudioRaiseVolume NoSymbol XF86AudioRaiseVolume

It seems, then, that the audio keys should work out of the box for this keyboard. Any ideas? Seems like there is some X configuration link I missed.

As an aside, if X is a windowing system, why is it handling things like audio as well?

Last edited by sherrellbc (2016-05-14 15:03:49)

Offline

#2 2016-05-15 15:40:33

sherrellbc
Member
Registered: 2014-05-26
Posts: 112

Re: Xmodmap [audio] key mappings not working

A better question, then, would be: If applicable, how did everyone else get audio controls working?

Offline

#3 2016-05-15 18:36:18

fluxboxer
Member
Registered: 2012-12-02
Posts: 118

Re: Xmodmap [audio] key mappings not working

If nothing (other replies) works, try this:

Remove ~/.Xmodmap and find the lines starting with "keycode (*)122", "keycode (*)123" (* being any character, likely "I") etc. in your /usr/share/X11/xkb/symbols/inet and replace their content with "XF86AudioLowerVolume", "XF86AudioRaiseVolume" etc. respectively.

If you use showkey the numbers it gives are 8 less then the xev's, that is, instead of 122 it gives 114.

After every system update overwriting that file you need to re-apply this.

Offline

Board footer

Powered by FluxBB