From bc63fc5a21ef96d624c5c3bb665375ff509d5990 Mon Sep 17 00:00:00 2001 From: Wirt Wolff Date: Sun, 6 Sep 2009 09:05:03 +0200 Subject: U.EZConfig: Correct additionalKeysP M2-M5 values Ignore-this: 938c9739a8e00c07195890938e7c12fc Was 8,9,10,11,12 rather than needed 8,16,32,64,128 darcs-hash:20090906070503-18562-080841f3293abb69f131cea108291651257811a5.gz --- XMonad/Util/EZConfig.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'XMonad/Util/EZConfig.hs') diff --git a/XMonad/Util/EZConfig.hs b/XMonad/Util/EZConfig.hs index 6e0a4c3..299138b 100644 --- a/XMonad/Util/EZConfig.hs +++ b/XMonad/Util/EZConfig.hs @@ -36,7 +36,7 @@ import XMonad.Actions.Submap import XMonad.Util.NamedActions import qualified Data.Map as M -import Data.List (foldl', intersperse, sortBy, groupBy, nub) +import Data.List (foldl', sortBy, groupBy, nub) import Data.Ord (comparing) import Data.Maybe import Control.Arrow (first, (&&&)) @@ -413,7 +413,8 @@ parseModifier c = (string "M-" >> return (modMask c)) +++ do char 'M' n <- satisfy (`elem` ['1'..'5']) char '-' - return (mod1Mask + (read [n]) - 1) + return $ indexMod (read [n] - 1) + where indexMod = (!!) [mod1Mask,mod2Mask,mod3Mask,mod4Mask,mod5Mask] -- | Parse an unmodified basic key, like @\"x\"@, @\"\"@, etc. parseKey :: ReadP KeySym @@ -441,7 +442,7 @@ keyNames = functionKeys ++ specialKeys ++ multimediaKeys -- | A list pairing function key descriptor strings (e.g. @\"\"@) with -- the associated KeySyms. functionKeys :: [(String, KeySym)] -functionKeys = [ ("F" ++ show n, k) +functionKeys = [ ('F' : show n, k) | (n,k) <- zip ([1..24] :: [Int]) [xK_F1..] ] -- | A list of special key names and their corresponding KeySyms. @@ -703,7 +704,7 @@ checkKeymap conf km = warn (doKeymapCheck conf km) ++ msg "duplicate" dup ++ "'" msg _ [] = "" msg m xs = m ++ " keybindings detected: " ++ showBindings xs - showBindings = concat . intersperse " " . map ((++"\"") . ("\""++)) + showBindings = unwords . map (("\""++) . (++"\"")) -- | Given a config and a list of (key sequence description, action) -- pairs, check the key sequence descriptions for validity, -- cgit v1.2.3