Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Fn + up/down works only in mplayer
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
jimmij
Tux's lil' helper
Tux's lil' helper


Joined: 02 Dec 2008
Posts: 139

PostPosted: Tue Apr 08, 2014 1:00 pm    Post subject: Fn + up/down works only in mplayer Reply with quote

I cannot set volume with function key (Fn+up/down). Other things like brightness (Fn+left/right) or NumLk (Fn+F11) works fine. The only place where Fn+up/down works is mplayer. I believe I should bind Fn+up/down to pcm or master in alsamixer, but how to do that?
_________________
Vanitas vanitatum et omnia vanitas.
Libera temet ex inferis.
Back to top
View user's profile Send private message
roseZ
n00b
n00b


Joined: 17 Dec 2005
Posts: 31
Location: Finland

PostPosted: Sat Apr 12, 2014 9:31 am    Post subject: Reply with quote

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:

"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.
Back to top
View user's profile Send private message
jimmij
Tux's lil' helper
Tux's lil' helper


Joined: 02 Dec 2008
Posts: 139

PostPosted: Sat Apr 12, 2014 3:06 pm    Post subject: Reply with quote

In fact I do not use any DE right now, just pure WM (sawfish). Under gnome Fn keys work fine, but I really hate recent gnome. I tried to use xmodmap which I believe is most basic way for linux, like
Code:
xmodmap -e 'keycode 38 = XF86AudioMute'
normally keycode 38 is assigned to letter 'a'
But again it works only in mplayer, to be precise when I hit letter 'a' everywhere but in mplayer nothing happens.
_________________
Vanitas vanitatum et omnia vanitas.
Libera temet ex inferis.
Back to top
View user's profile Send private message
roseZ
n00b
n00b


Joined: 17 Dec 2005
Posts: 31
Location: Finland

PostPosted: Sun Apr 13, 2014 6:47 am    Post subject: Reply with quote

That's just it: you've told X that pressing 'a' should count as pressing 'XF86AudioMute', but neither Sawfish nor X is configured to do anything with it (except pass the keypress event to the active application). If, unlike mplayer, the application is not programmed to respond to XF86AudioMute, nothing will happen. That's why I suggested using xbindkeys to do something about those keypresses in my earlier post (or use the facilities of your WM, if it provides them).

By the way, your brightness keys probably work because they are recognized on a lower level (maybe ACPI or even hardware, It's the same on my laptop) and normal numlock behaviour is always the default.
Back to top
View user's profile Send private message
jimmij
Tux's lil' helper
Tux's lil' helper


Joined: 02 Dec 2008
Posts: 139

PostPosted: Mon Apr 14, 2014 1:05 am    Post subject: Reply with quote

OK, thanks for your help, it works.
_________________
Vanitas vanitatum et omnia vanitas.
Libera temet ex inferis.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum