summaryrefslogtreecommitdiffstats
path: root/tv/2configs/xserver/xmonad/Util/Submap.hs
diff options
context:
space:
mode:
authorlassulus <lass@aidsballs.de>2015-10-31 00:13:32 +0100
committerlassulus <lass@aidsballs.de>2015-10-31 00:13:32 +0100
commit5b4a34062462311973bb1798fe3e4538e6eb5706 (patch)
tree31ac952feeb3f534b57fc48c6ae2f71795be2f43 /tv/2configs/xserver/xmonad/Util/Submap.hs
parent611f8ef25b4c3984f2f7de7362c4869d1f2f124f (diff)
parentbcaf3771d9503f1b0d01a2c15ca0712ee454342f (diff)
Merge remote-tracking branch 'cd/master'
Diffstat (limited to 'tv/2configs/xserver/xmonad/Util/Submap.hs')
-rw-r--r--tv/2configs/xserver/xmonad/Util/Submap.hs31
1 files changed, 0 insertions, 31 deletions
diff --git a/tv/2configs/xserver/xmonad/Util/Submap.hs b/tv/2configs/xserver/xmonad/Util/Submap.hs
deleted file mode 100644
index b09b97cc2..000000000
--- a/tv/2configs/xserver/xmonad/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)