Search code examples
haskellxmonad

In xmonad, how to remap CapsLock to Ctrl?


I'm new to xmonad, and trying to remap CapsLock to Ctrl.

I think I can do this by adding a ~/.xmonad/xmonad.hs file as suggested at this xmonad setup tutorial, and it seems that the xmonad.hs file should look something like the example given at the xmonad FAQ page.

import XMonad

main = xmonad defaultConfig
         { modMask = mod4Mask
         , terminal = "urxvt"
         }

I'm not sure exactly how the various fields there modMask, mod4Mask, terminal, and "urxvt" represent keyboard keys, or what field to use to represent my CapsLock and Ctrl keys.

How exactly do I remap my CapsLock to Ctrl?

Is there documentation somewhere describing the field associated with each key, CapsLock, Ctrl, etc.?

P.S. As a side-note this mailing list item also says something about xmonad keymay rebinding, but it does not appear to be haskell.


Solution

  • @melpomene's comment led me to seek something other than xmonad for performing the keybinding remap.

    Instead I used xmodmap following the instructions described at this blog, Changing your caps lock into Ctrl in X.