You are not logged in.

#1 2009-04-19 02:34:31

soupcan
Member
From: ?
Registered: 2008-10-25
Posts: 268

[Solved] showkey&xev errors; extra keys don't work

As in the title, showkey and xev report different keycodes. showkey gives my Play/Pause extra key keycode 162, while xev shows 172. 172 seems to be correct, as I have play/pause, stop, next and previous working. However, all of the keycodes given for my mute and raise/lower volume keys do not work. I'd really like to be able to control system-wide volume without opening up alsamixer. Getting my extra keys working has been an issue since the first day of my install, and I'd really like to resolve it. I'm using xmodmap to set the keys. Here is my config:

keycode 121 = XF86AudioMute
keycode 173 = XF86AudioPrev
keycode 172 = XF86AudioPlay
keycode 171 = XF86AudioNext
keycode 174 = XF86AudioStop
keycode 122 = XF86AudioLowerVolume
keycode 123 = XF86AudioRaiseVolume

Again, all of the keys except the volume related ones work. Please help.

Last edited by soupcan (2009-04-20 00:40:29)

Offline

#2 2009-04-19 03:41:21

jt512
Member
Registered: 2009-02-19
Posts: 262

Re: [Solved] showkey&xev errors; extra keys don't work

Get the keycodes by using xev, since those are the keycodes that xmodmap uses.  After associating the audio keysymnames (XF86AudioStop, etc.) to the correct keycodes, you must bind a command to each kyesmname in your window/desktop manager.  For instance, I have the command "aumix -v+5" bound to XF86AudioRaiseVolume.  How you accomplish the keybindings is different in every WM/DM. In openbox it's done in the rc.xml file.  In Xfce4 it's done in the keyboard settings dialog.

Jay

Last edited by jt512 (2009-04-19 03:42:30)

Offline

#3 2009-04-19 04:02:41

soupcan
Member
From: ?
Registered: 2008-10-25
Posts: 268

Re: [Solved] showkey&xev errors; extra keys don't work

jt512 wrote:

Get the keycodes by using xev, since those are the keycodes that xmodmap uses.  After associating the audio keysymnames (XF86AudioStop, etc.) to the correct keycodes, you must bind a command to each kyesmname in your window/desktop manager.  For instance, I have the command "aumix -v+5" bound to XF86AudioRaiseVolume.  How you accomplish the keybindings is different in every WM/DM. In openbox it's done in the rc.xml file.  In Xfce4 it's done in the keyboard settings dialog.

Jay

All of the keycodes in my config are from xev. Is there a way to set this up properly in awesome?

Last edited by soupcan (2009-04-19 04:05:11)

Offline

#4 2009-04-20 00:39:19

soupcan
Member
From: ?
Registered: 2008-10-25
Posts: 268

Re: [Solved] showkey&xev errors; extra keys don't work

After some experimentation, I managed to get them working by adding the following to my aweosmerc:

key({}, "#122", function () awful.util.spawn("amixer -q sset PCM 2dB-") end),
    key({}, "#123", function () awful.util.spawn("amixer -q sset PCM 2dB+") end),
    key({}, "XF86AudioMute", function () awful.util.spawn("amixer -q sset Master toggle") end),

Offline

Board footer

Powered by FluxBB