You are not logged in.

#1 2008-11-04 05:13:22

Odd-rationale
Member
Registered: 2008-02-05
Posts: 102

[Solved] Multimedia Keys in dwm

Hello! Does anyone know how to get Multimedia keys to work in dwm?

I tried something like this in my config.h, after defining the voldowncmd of course:

#include <X11/XF86keysym.h>
...
{ 0,                            XF86XK_AudioLowerVolume, spawn, {.v = voldowncmd } }

But that didn't work.

I googled, and it seems like it was possible to do something like this in the past, but I guess the config.h changed...

I would prefer not to use xbindkeys if possible.

Thanks for your help!

Last edited by Odd-rationale (2008-11-04 06:51:44)

Offline

#2 2008-11-04 06:37:48

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

Re: [Solved] Multimedia Keys in dwm

That looks about right--actually someone just posted within the past couple of days asking nearly the same thing and it worked for them.  Are you sure the key is properly identified by X as XF86AudioLowerVolume?


thayer williams ~ cinderwick.ca

Offline

#3 2008-11-04 06:50:58

Odd-rationale
Member
Registered: 2008-02-05
Posts: 102

Re: [Solved] Multimedia Keys in dwm

Actually, I solved it. It turned out to be a problem with how I defined the voldowncmd.

Here is how it looks now:

/* commands */
static const char *volupcmd[]  = { "mpc", "volume", "+1", NULL };
static const char *voldowncmd[]  = { "mpc", "volume", "-1", NULL };

static Key keys[] = {
    /* modifier                     key        function        argument */
    { 0,                            0x1008ff13, spawn,         {.v = volupcmd } },
    { 0,                            0x1008ff11, spawn,         {.v = voldowncmd } },
};

I also decided to use the keycodes instead of XF86*. That way, "#include <X11/XF86keysym.h>" is unnecessary.

Anyways, glad I got this solved!

Offline

Board footer

Powered by FluxBB