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!

link|improve this question

feedback

4 Answers

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.

link|improve this answer
I tried KeyTouch and the Ubuntu Wiki pages without success. Thanks though! – Wuffers Nov 13 '10 at 16:10
feedback

You need to configure a hal policy.

link|improve this answer
feedback

Heres what I chucked in my rc.xml

    <keybind key="XF86AudioRaiseVolume">
  <action name="Execute">
    <execute>amixer sset -q Master,0 5%+</execute>
  </action>
</keybind> 
<keybind key="XF86AudioLowerVolume">
  <action name="Execute">
    <execute>amixer sset -q Master,0 5%-</execute>
  </action>
</keybind>
<keybind key="XF86AudioMute">
  <action name="Execute">
    <execute>ExecCommand amixer sset -q Master,0 toggle</execute>
  </action>
</keybind>
link|improve this answer
feedback

In a similar situation on a laptop, I let the window manager (Fluxbox) handle the events via the following keyboard shortcuts in ~/.fluxbox/keys:

XF86AudioLowerVolume    :ExecCommand amixer sset -q Master,0 5%- 
XF86AudioRaiseVolume    :ExecCommand amixer sset -q Master,0 5%+ 
XF86AudioMute           :ExecCommand amixer sset -q Master,0 toggle

Crunchbang uses OpenBox as default as I understand, so maybe the solution is similar to my Fluxbox one.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.