You are not logged in.

#1 2011-01-22 03:46:04

Ipozya
Member
Registered: 2011-01-20
Posts: 52

Extra keys laptop (tried xmodmap and xbindkeys) [SOLVED]

Hello everyone,

I am aware that there are plenty of threads on this very issue and I have read several and have followed the suggestions without positive results.  I am running a Sony Vaio VGN-FW480J and wish to just get raise and lower volume buttons to work.  I am using fluxbox and found through xev that keycode 122 is to lower and keycode 123 is to raise.  I first tried using xmodmap to fix the issue.  I placed the following in a newly created ~/.Xmodmap file

keycode 122 = XF86AudioLowerVolume
keycode 123 = XF86AudioRaiseVolume

After running xmodmap ~/.Xmodmap, the issue persists even after restarting X.

I then continued reading arch wiki and tried with xbindkeys.  After installing, I added the following to newly created file ~/.xbindkeysrc:

# Decrease volume
"amixer set Master playback 1-"
    m:0x0 + c:122
    XF86AudioLowerVolume

# Increase volume
"amixer set Master playback 1+"
    m:0x0 + c:123
    XF86AudioRaiseVolume

I added "xbindkeys &" to .xinitrc, and the configuration still does not work.  Does anyone have any additional suggestions for me?

Thank you in advance.

Last edited by Ipozya (2011-01-23 03:08:33)

Offline

#2 2011-01-22 17:23:20

measure
Member
Registered: 2009-07-17
Posts: 62

Re: Extra keys laptop (tried xmodmap and xbindkeys) [SOLVED]

First, I should mention that I have the exact same line sin my .xinitrc, and it works for me (though on a completely different system).  However, I do not have those lines in my .Xmodmap, I think this might be throwing off xbindkeys.  Try removing these first.

If that doesn't work, I suppose there are a few things you could try and a few things which might be causing this issue

There's another way to get the xbindkeys stuff without xev, make sure xbindkeys is not running and run ' xbindkeys -k ' and press your volume down key.  Mine does something like this:

[ryan@HAL9002 ~]$ xbindkeys -k
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:0x0 + c:122
    XF86AudioLowerVolume

I can't see exactly how this would be different, and it seems to me like it is using xev to do this, but it's worth a try I guess.  Interestingly, when I run 'xbindkeys -k' with another instance of xbindkeys running to map my volume keys, the 'xbindkeys -k' does not register the volume keys.  The other one intercepts it first.  This might be a way to check if your initial xbindkeys is intercepting the key press.

You could replace the command ' amixer set Master playback 1- ' with something like ' xterm ' to see if the issue is in running the amixer command, specifically.  I.e. if pressing the key opens a terminal, then clearly something is working.   But if it can't even open a terminal, then it's obvious that xbindkeys is not intercepting the event.

Along that line of reasoning, does just running the command ' amixer set Master playback 1- ' from the terminal lower your volume?  I am sure this works, but who knows other than you.

Finally, on my computer, the mute button actually turns off the speakers independent of alsa (i.e. it doesn't change the alsa status of the speakers to off, but does mute them).  Oddly enough, on one of my computers (Thinkpad x40) this is also true for the volume buttons: they are independent of alsa.  However on my newer laptop (Thinkpad T410), the volume keys have to be mapped to these commands as you have tried.  Perhaps your volume keys want to be doing things independent of alsa, but the functionality is not in the kernel, or something (I used to have to map the mut button on my T410 with xbindkeys, but one kernel upgrade it just magically started working otherwise).  I'm being vague here because I don't exactly understand this.

Anyway, these are just some simple sanity checks, which will most likely not help you.  But it's never a bad idea to check the simple things first.

Last edited by measure (2011-01-22 17:24:46)

Offline

#3 2011-01-23 03:07:59

Ipozya
Member
Registered: 2011-01-20
Posts: 52

Re: Extra keys laptop (tried xmodmap and xbindkeys) [SOLVED]

Ah I should have known what to do tongue
I had to put xbindkeys & in the ~/.fluxbox/startup instead of .xinitrc.  Thank you very much for your lengthy and helpful post measure.

Offline

Board footer

Powered by FluxBB