diff options
author | Andrea Rossato <andrea.rossato@unibz.it> | 2007-11-16 16:51:10 +0100 |
---|---|---|
committer | Andrea Rossato <andrea.rossato@unibz.it> | 2007-11-16 16:51:10 +0100 |
commit | 2f2ea15b90f5d11e090171c27e743efeee2ac324 (patch) | |
tree | e6fd6713e3227a8f7f36b6c3b3df82d468323c3b | |
parent | 42fe54f1faa1d63509540d7a8f8ecaab4ad3707e (diff) | |
download | XMonadContrib-2f2ea15b90f5d11e090171c27e743efeee2ac324.tar.gz XMonadContrib-2f2ea15b90f5d11e090171c27e743efeee2ac324.tar.xz XMonadContrib-2f2ea15b90f5d11e090171c27e743efeee2ac324.zip |
Documentation: added the section for adding and removing key bindings
darcs-hash:20071116155110-32816-2ee2f76213887f4b0576bb309aa5f863cd271ff5.gz
-rw-r--r-- | Documentation.hs | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/Documentation.hs b/Documentation.hs index dfec3db..157b46e 100644 --- a/Documentation.hs +++ b/Documentation.hs @@ -331,7 +331,39 @@ provided by the xmonad-contrib library. Look, for instance, at {- $keyAddDel -keyAddDel +Adding and removing key bindings requires to compose the action of +removing and, after that, the action of adding. + +This is an example you may find in "XMonad.Config.Arossato": + + +> defKeys = keys defaultConfig +> delKeys x = foldr M.delete (defKeys x) (toRemove x) +> newKeys x = foldr (uncurry M.insert) (delKeys x) (toAdd x) +> -- remove some of the default key bindings +> toRemove x = +> [ (modMask x , xK_j ) +> , (modMask x , xK_k ) +> , (modMask x , xK_p ) +> , (modMask x .|. shiftMask, xK_p ) +> , (modMask x .|. shiftMask, xK_q ) +> , (modMask x , xK_q ) +> ] ++ +> -- I want modMask .|. shiftMask 1-9 to be free! +> [(shiftMask .|. modMask x, k) | k <- [xK_1 .. xK_9]] +> -- These are my personal key bindings +> toAdd x = +> [ ((modMask x , xK_F12 ), xmonadPrompt defaultXPConfig ) +> , ((modMask x , xK_F3 ), shellPrompt defaultXPConfig ) +> ] ++ +> -- Use modMask .|. shiftMask .|. controlMask 1-9 instead +> [( (m .|. modMask x, k), windows $ f i) +> | (i, k) <- zip (workspaces x) [xK_1 .. xK_9] +> , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask .|. controlMask)] +> ] + +You can achieve the same result by using "XMonad.Util.CustomKeys" and, +specifically, 'XMonad.Util.CustomKeys.customKeys'. -} |