[xmonad] how to map XF86* keys?

Viktor Deryagin vderyagin at gmail.com
Sun Jan 10 08:25:59 EST 2010


On Sun, Jan 10, 2010 at 7:42 AM, Chengqi Song <songcq at gmail.com> wrote:
> Hi All,
>
> I want to map my vol up and vol down keys. I used xev to capture their info as follows:
>
> KeyRelease event, serial 27, synthetic NO, window 0x1600001,
>    root 0x115, subw 0x0, time 1035672, (320,301), root:(321,319),
>    state 0x0, keycode 122 (keysym 0x1008ff11, XF86AudioLowerVolume), same_screen YES,
>    XLookupString gives 0 bytes:
>    XFilterEvent returns: False
>
> KeyPress event, serial 27, synthetic NO, window 0x1600001,
>    root 0x115, subw 0x0, time 1036158, (320,301), root:(321,319),
>    state 0x0, keycode 123 (keysym 0x1008ff13, XF86AudioRaiseVolume), same_screen YES,
>    XLookupString gives 0 bytes:
>    XmbLookupString gives 0 bytes:
>    XFilterEvent returns: False
>
> but I dont know how to use them in my xmonad.hs like other keys:
>
> myKeys = \c -> mkKeymap c $
>    -- volume key binding
>    [ ("M-=", spawn "aumix2pipe +10")
>    , ("M--", spawn "aumix2pipe -10")
>
>
> Could anyone provide a solution?

It's simple:

 myKeys = \c -> mkKeymap c $
    -- volume key binding
    [ ("<XF86AudioRaiseVolume>", spawn "aumix2pipe +10")
    , ("<XF86AudioLowerVolume>", spawn "aumix2pipe -10")]


More information about the xmonad mailing list