diff options
Diffstat (limited to 'src/Rahm/Desktop/Keys')
| -rw-r--r-- | src/Rahm/Desktop/Keys/Wml.hs | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/Rahm/Desktop/Keys/Wml.hs b/src/Rahm/Desktop/Keys/Wml.hs index 10f2b5f..623e59a 100644 --- a/src/Rahm/Desktop/Keys/Wml.hs +++ b/src/Rahm/Desktop/Keys/Wml.hs @@ -14,7 +14,7 @@ -- \%@s // All windows except those on workspace 's' module Rahm.Desktop.Keys.Wml where -import Control.Monad (forM_, join, unless) +import Control.Monad (forM_, join, unless, when) import Control.Monad.Trans.Class import Control.Monad.Trans.Maybe import Control.Monad.Trans.State as S @@ -67,7 +67,11 @@ data Workspace = forall a. readWorkspaceMacro :: MaybeT X () readWorkspaceMacro = - mapNextStringWithKeysym $ \mask sym _ -> do + mapNextStringWithKeysym $ \mask sym s -> do + when (sym == xK_Escape) $ + fail "" + + lift $ setPendingBuffer $ printf "Rec %s " s macro <- readMacroString lift $ XS.modify $ \m -> @@ -77,7 +81,11 @@ readWorkspaceMacro = readWindowsetMacro :: MaybeT X () readWindowsetMacro = - mapNextStringWithKeysym $ \mask sym _ -> do + mapNextStringWithKeysym $ \mask sym s -> do + when (sym == xK_Escape) $ + fail "" + + lift $ setPendingBuffer $ printf "Rec %s " s macro <- readMacroString lift $ XS.modify $ \m -> @@ -90,7 +98,9 @@ readMacroString = do mapNextStringWithKeysym $ \m k s -> case (m, k, s) of _ | k == xK_Return -> return [] _ | k == xK_Escape -> MaybeT $ return Nothing - r -> ([r] ++) <$> readMacroString + r -> do + lift $ addStringToPendingBuffer s + ([r] ++) <$> readMacroString justWorkspace :: String -> Workspace justWorkspace s = |