PDA

View Full Version : keyboard volume keys not working



drama
21st June 2007, 11:02 AM
recently installed f7 on my desktop and am loving it at the moment. however ive ran into one small problem. i cant get the volume keys on my keyboard to work. i tried google first and came accross something called xmodmap. i used xev to get the keycodes i needed. but the rest made no sense to me. is this the only way to map the keys or is there a much simpler to do this. any help would be greatly appreciated. thankx in advance :)

p.s. i use kde if that helps at all.

ankit
21st June 2007, 11:17 AM
Go to ... Main Menu => System => Preferences => Keyboard Shortcuts => Sound
Now select the items & press your keys which you want to use for volume increase, decrease or mute/unmute. I got my volume keys working in this way. Check, whether it helps you or not.

drama
21st June 2007, 11:56 AM
Go to ... Main Menu => System => Preferences => Keyboard Shortcuts => Sound
Now select the items & press your keys which you want to use for volume increase, decrease or mute/unmute. I got my volume keys working in this way. Check, whether it helps you or not.


is that in gnome? i ask because i havent anything like that. i use kde myself. i have to go menu---> control center---> regional and accessibility---> keyboard shortcuts. but there isnt anything that has to do with audio. however ive figured out that if i start kmix the volume buttons work. however this also poses problems. i have to manually start kmix at each logon. plus for some odd reason the "e" key doesnt work on my keyboard while kmix is running but functions fine after closing kmix. ever seen that happen before? or know how it can be fixed?

ankit
21st June 2007, 12:27 PM
Yes, Gnome.

Dies
21st June 2007, 02:37 PM
is that in gnome? i ask because i havent anything like that. i use kde myself. i have to go menu---> control center---> regional and accessibility---> keyboard shortcuts. but there isnt anything that has to do with audio. however ive figured out that if i start kmix the volume buttons work. however this also poses problems. i have to manually start kmix at each logon. plus for some odd reason the "e" key doesnt work on my keyboard while kmix is running but functions fine after closing kmix. ever seen that happen before? or know how it can be fixed?


I use XBindKeys and it works well for me, just install it with yum then find out the key codes you need by running in a terminal

xbindkeys -k to identify just one key or

xindkeys -mk for multiple keys at once

a new window will appear, just place your cursor over that window and press the keys you want identified, you will get some output like



[~]$ xbindkeys -mk
Press combination of keys or/and click under the window.
You can use one of the two lines after "NoCommand"
in $HOME/.xbindkeysrc to bind a key.

"(Scheme function)"
m:0x10 + c:130
Mod2 + NoSymbol


Once you have the codes just run

xbindkeys -d

to print a default config in your /home named .xbindkeysrc , then open it, it's a hidden file of course, and add the keys and commands you want to run, here's mine just as an example, it controls both the regular output and digital output at the same time so if your needs are different you'll just have to adjust the channels controlled



# For the benefit of emacs users: -*- shell-script -*-
###########################
# xbindkeys configuration #
###########################
#
# Version: 1.8.0
#
# If you edit this file, do not forget to uncomment any lines
# that you change.
# The pound(#) symbol may be used anywhere for comments.
#
# To specify a key, you can use 'xbindkeys --key' or
# 'xbindkeys --multikey' and put one of the two lines in this file.
#
# The format of a command line is:
# "command to start"
# associated key
#
#
# A list of keys is in /usr/include/X11/keysym.h and in
# /usr/include/X11/keysymdef.h
# The XK_ is not needed.
#
# List of modifier:
# Release, Control, Shift, Mod1 (Alt), Mod2 (NumLock),
# Mod3 (CapsLock), Mod4, Mod5 (Scroll).
#

# The release modifier is not a standard X modifier, but you can
# use it if you want to catch release events instead of press events

# By defaults, xbindkeys does not pay attention with the modifiers
# NumLock, CapsLock and ScrollLock.
# Uncomment the lines above if you want to pay attention to them.

#keystate_numlock = enable
#keystate_capslock = enable
#keystate_scrolllock= enable

##################################
# Volume Keys Setup #
##################################


# Mute
"amixer sset Front toggle;amixer sset IEC958 toggle"
m:0x10 + c:160
Mod2 + NoSymbol

# Decrease Volume
"amixer sset Front 1- unmute;amixer sset IEC958 1- unmute"
m:0x10 + c:174
Mod2 + NoSymbol

# Increase Volume
"amixer sset Front 1+ unmute;amixer sset IEC958 1+ unmute"
m:0x10 + c:176
Mod2 + NoSymbol

##################################
# Amarok Configuration #
##################################

# Launch Amarok
"amarok"
m:0x10 + c:129
Mod2 + NoSymbol

# Play/Pause
"amarok --play-pause"
m:0x10 + c:162
Mod2 + NoSymbol

# Previous
"amarok --previous"
m:0x10 + c:144
Mod2 + NoSymbol

# Next
"amarok --next"
m:0x10 + c:153
Mod2 + NoSymbol

# Stop
"amarok --stop"
m:0x10 + c:164
Mod2 + NoSymbol


##################################
# End of xbindkeys configuration #
##################################


Nice thing is you can run any command and it works across distros and desktops so you can just save the config and if you switch distros or re-install or whatever all you need to do is install XBindKeys and drop your config into place.

drama
21st June 2007, 03:07 PM
ty ill try that this evening

briguy
10th July 2007, 11:17 PM
The easiest way to get this working is to go to Settings --> Regional & Accessibility --> Keyboard Layout and select a keyboard that has multimedia features. I'm using a Logitech keyboard of some variety, and I've selected the Microsoft Wireless Multimedia Keyboard 1.0A which seems to do the trick. No messing around with XBindKeys!

Spode
23rd August 2007, 10:18 PM
Yes, Gnome.

I am both impressed and annoyed at how easy that was.

I've spent hours fiddling with lineakd, xmodmap and other such things. I had some success with lineakd but it was far from perfect as for some reason it got in the way of Amarok shortcuts.