[xmonad] How to find the XF86Launch1-Key reference?

Adam Vogt vogt.adam at gmail.com
Fri Sep 25 21:21:54 EDT 2009


* On Friday, September 25 2009, Sergey Manucharian wrote:

...
>    -- XF86AudioStop
>    , ((0            , 0x1008ff15), spawn "player-stop")
>-------------------------8<------------------------------
>
>It works fine for me, as you can see, I use "0x1008ff41" keysym
>directly.

Here are two alternative methods of getting those keysyms:

If you have X11 > 1.4.2 which was build with the XF86keysym.h header
available, you can import Graphics.X11.ExtraTypes.XF86, and then use the
keysyms defined there:

http://hackage.haskell.org/packages/archive/X11/1.4.5/doc/html/Graphics-X11-ExtraTypes-XF86.html


If you don't have that module, can use CPP which could be preferable to
using the numeric values of the keysyms:

------------ Config Using CPP to add keysyms -------------------------
{-# LANGUAGE CPP #-}
module Main where

import XMonad
import XMonad.Util.EZConfig

#include <X11/XF86keysym.h>

modm = mod4Mask

main = xmonad $ defaultConfig { modMask = modm } `additionalKeys`
    [((modm,XF86XK_Launch1), spawn "foo")
    ,((modm,XF86XK_AudioLowerVolume), spawn "ossmix vmix0-outvol -- -1")
    ]
----------------------------------------------------------------------

Regards,
Adam


More information about the xmonad mailing list