How to stop multimedia buttons from typing random characters in linux

I am using esekeyd to run programs with the media buttons but certain ones type randomness into whatever program I happen to be running.
Check out the info pages for loadkeys, showkey, and keymaps.
Use showkey to get the codes for your media buttons, they'll come up as hex which is ok or decimal is fine too
on my system decimal
113 = mute
114 = volume down
115 = volume up
the other buttons are 163, 164, 165, and 166
cd /usr/share/keymap/i386/qwerty
gunzip defkeymap.kmap.gz
nano defkeymap.kmap
search for our numbers (^w) and make them all
keycode xxx =
if the number isn't there, add it
keycode 113 =
keycode 114 =
keycode 115 =
exit and save (^x)
gzip defkeymap.kmap
loadkeys -sd
Happy media button pressing without random chars!
Note: you want to add all multimedia buttons even if they don't seem to write anything because some of them write null chars for some reason.


Comments powered by Disqus