Use volume keys under Linux

audiocrunchbangkeyboard

I have a keyboard that is just a generic Gateway one that I got with my PC. I was wondering if it was possible to use the volume keys on it. I have the output from xev after pressing both the volume up and volume down keys.

KeyPress event, serial 35, synthetic NO, window 0x2000001,
root 0x162, subw 0x0, time 3904956, (-45,-188), root:(378,348),
state 0x0, keycode 122 (keysym 0x1008ff11, XF86AudioLowerVolume), same_screen YES,
XLookupString gives 0 bytes: 
XmbLookupString gives 0 bytes: 
XFilterEvent returns: False

KeyRelease event, serial 38, synthetic NO, window 0x2000001,
root 0x162, subw 0x0, time 3905056, (-45,-188), root:(378,348),
state 0x0, keycode 122 (keysym 0x1008ff11, XF86AudioLowerVolume), same_screen YES,
XLookupString gives 0 bytes: 
XFilterEvent returns: False

KeyPress event, serial 38, synthetic NO, window 0x2000001,
root 0x162, subw 0x0, time 3906475, (-45,-188), root:(378,348),
state 0x0, keycode 123 (keysym 0x1008ff13, XF86AudioRaiseVolume), same_screen YES,
XLookupString gives 0 bytes: 
XmbLookupString gives 0 bytes: 
XFilterEvent returns: False

KeyRelease event, serial 38, synthetic NO, window 0x2000001,
root 0x162, subw 0x0, time 3906574, (-45,-188), root:(378,348),
state 0x0, keycode 123 (keysym 0x1008ff13, XF86AudioRaiseVolume), same_screen YES,
XLookupString gives 0 bytes: 
XFilterEvent returns: False

So, what can I do to get these to change my volume under Crunchbang Linux?

Thanks in advance!

Best Answer

Under Ubuntu, an easy (usually) way is to install KeyTouch. If your keyboard is not supported out of the box, you need both the keytouch and keytouch-editor packages. Run the keytouch editor, and configure your keyboard.

Other relevant Ubuntu wiki pages are Hotkeys/Troubleshooting (but try KeyTouch first) and Hotkeys/Architecture (explaining this is not as simple a it should be under the hood).

I don't know how relevant this information is for Crunchbang, which is based on Ubuntu but might have changed things related to keyboard configuration.

Related Question