summaryrefslogtreecommitdiffstats
path: root/tv/5pkgs/xmonad-tv/Util/Submap.hs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2015-11-09 17:58:53 +0100
committertv <tv@krebsco.de>2015-11-09 17:58:53 +0100
commit619e0ea9489d4d3e141671f600598468b26b4e72 (patch)
treed7c8c8708f5e6b02ccd9daa0638564047e5b781e /tv/5pkgs/xmonad-tv/Util/Submap.hs
parent604ce6bd59c74f59ac9f18e3e82fa26e8ace8462 (diff)
xmonad-tv: use xmonad-stockholm
Diffstat (limited to 'tv/5pkgs/xmonad-tv/Util/Submap.hs')
-rw-r--r--tv/5pkgs/xmonad-tv/Util/Submap.hs31
1 files changed, 0 insertions, 31 deletions
diff --git a/tv/5pkgs/xmonad-tv/Util/Submap.hs b/tv/5pkgs/xmonad-tv/Util/Submap.hs
deleted file mode 100644
index b09b97cc2..000000000
--- a/tv/5pkgs/xmonad-tv/Util/Submap.hs
+++ /dev/null
@@ -1,31 +0,0 @@
--- This module is based on Jason Creighton's XMonad.Actions.Submap
-
-module Util.Submap
- ( submapString
- ) where
-
-import Data.Bits
-import XMonad hiding (keys)
-import qualified Data.Map as M
-import Control.Monad.Fix (fix)
-
-
--- | Like 'XMonad.Actions.Submap.submapDefault', but provides the looked up string to the default action.
-submapString :: (String -> X ()) -> M.Map (KeyMask, KeySym) (X ()) -> X ()
-submapString def keys = do
- XConf { theRoot = root, display = d } <- ask
-
- (m, s, str) <- io $ allocaXEvent $ \p -> fix $ \nextkey -> do
- maskEvent d keyPressMask p
- KeyEvent { ev_keycode = code, ev_state = m } <- getEvent p
- keysym <- keycodeToKeysym d code 0
- if isModifierKey keysym
- then nextkey
- else do
- (mbKeysym, str) <- lookupString (asKeyEvent p)
- return (m, keysym, str)
-
- -- Remove num lock mask and Xkb group state bits
- m' <- cleanMask $ m .&. ((1 `shiftL` 12) - 1)
-
- maybe (def str) id (M.lookup (m', s) keys)