aboutsummaryrefslogtreecommitdiffstats
path: root/Submap.hs
diff options
context:
space:
mode:
authorAndrea Rossato <andrea.rossato@unibz.it>2007-06-14 16:43:48 +0200
committerAndrea Rossato <andrea.rossato@unibz.it>2007-06-14 16:43:48 +0200
commit2360e0ff921e7a3c03cb93a47f91911947614645 (patch)
tree568ce133b0dc6fa1a0a08d995a5e35911b0feeca /Submap.hs
parent5e444e1fe39d33d994f1dfc3087dc2a34c91bf91 (diff)
downloadXMonadContrib-2360e0ff921e7a3c03cb93a47f91911947614645.tar.gz
XMonadContrib-2360e0ff921e7a3c03cb93a47f91911947614645.tar.xz
XMonadContrib-2360e0ff921e7a3c03cb93a47f91911947614645.zip
Submap.hs: info and documentation
darcs-hash:20070614144348-32816-3eaae908dbc6d07810fdb8ae4d6a598b5c07cd01.gz
Diffstat (limited to 'Submap.hs')
-rw-r--r--Submap.hs54
1 files changed, 36 insertions, 18 deletions
diff --git a/Submap.hs b/Submap.hs
index 987ff46..0dee401 100644
--- a/Submap.hs
+++ b/Submap.hs
@@ -1,21 +1,22 @@
-{-
-Allows you to create a sub-mapping of keys. Example:
-
- , ((modMask, xK_a), submap . M.fromList $
- [ ((0, xK_n), spawn "mpc next")
- , ((0, xK_p), spawn "mpc prev")
- , ((0, xK_z), spawn "mpc random")
- , ((0, xK_space), spawn "mpc toggle")
- ])
-
-So, for example, to run 'spawn "mpc next"', you would hit mod-a (to trigger the
-submapping) and then 'n' to run that action. (0 means "no modifier"). You are,
-of course, free to use any combination of modifiers in the submapping. However,
-anyModifier will not work, because that is a special value passed to XGrabKey()
-and not an actual modifier.
--}
-
-module XMonadContrib.Submap where
+-----------------------------------------------------------------------------
+-- |
+-- Module : XMonadContrib.Submap
+-- Copyright : (c) Jason Creighton <jcreigh@gmail.com>
+-- License : BSD3-style (see LICENSE)
+--
+-- Maintainer : Jason Creighton <jcreigh@gmail.com>
+-- Stability : unstable
+-- Portability : unportable
+--
+-- A module that allows the user to create a sub-mapping of keys bindings.
+--
+-----------------------------------------------------------------------------
+
+module XMonadContrib.Submap (
+ -- * Usage
+ -- $usage
+ submap
+ ) where
import Control.Monad.Reader
@@ -25,6 +26,23 @@ import Graphics.X11.Xlib
import Graphics.X11.Xlib.Extras
import qualified Data.Map as M
+{- $usage
+Allows you to create a sub-mapping of keys. Example:
+
+> , ((modMask, xK_a), submap . M.fromList $
+> [ ((0, xK_n), spawn "mpc next")
+> , ((0, xK_p), spawn "mpc prev")
+> , ((0, xK_z), spawn "mpc random")
+> , ((0, xK_space), spawn "mpc toggle")
+> ])
+
+So, for example, to run 'spawn \"mpc next\"', you would hit mod-a (to trigger the
+submapping) and then 'n' to run that action. (0 means \"no modifier\"). You are,
+of course, free to use any combination of modifiers in the submapping. However,
+anyModifier will not work, because that is a special value passed to XGrabKey()
+and not an actual modifier.
+-}
+
submap :: M.Map (KeyMask, KeySym) (X ()) -> X ()
submap keys = do
XConf { theRoot = root, display = d } <- ask