Mplayer recognizes some multimedia keys (like XF86AudioRaiseVolume) out of the box, but configuring them outside specific applications depends on the desktop environment you're using.
Personally, I use x11-misc/xbindkeys which is DE agnostic. In case you want to give it a try, here's a part of my ~/.xbindkeysrc as a tip on how to control the ALSA mixer (for card 0):
Code: Select all
"amixer -q -c 0 set PCM toggle"
XF86AudioMute
"amixer -q -c 0 set PCM Playback 10%+"
XF86AudioRaiseVolume
"amixer -q -c 0 set PCM Playback 10%-"
XF86AudioLowerVolume
That uses amixer from media-sound/alsa-utils package. In case you need one, the Arch folks have written a nice
intro on using xbindkeys.