Wednesday, January 8, 2014

Emulating media keys with xmodmap

I got a new keyboard for Christmas, a mechanical one made using the same process as the old IBM model M ones.

The only issue is that I actually use my media keys to play/pause etc... and this keyboard has none, so using xmodmap and information from the Debian wiki and askubuntu I was able to remap the numeric keypad keys which I never use anyway to emulate multimedia keys.

The following sets "5" to play/pause, 8/2 to volume up/down, 4/6 to previous/next and 7 to mute/unmute.

File "xmodmaprc"
keycode 79 = XF86AudioMute
keycode 88 = XF86AudioLowerVolume
keycode 80 = XF86AudioRaiseVolume
keycode 84 = XF86AudioPlay
keycode 83 = XF86AudioPrev
keycode 85 = XF86AudioNext
Command to run
xmodmap xmodmaprc

No comments:

Post a Comment