diff options
| author | Josh Rahm <rahm@google.com> | 2024-03-05 18:20:43 -0700 |
|---|---|---|
| committer | Josh Rahm <rahm@google.com> | 2024-03-05 18:20:43 -0700 |
| commit | c50a8375cd37d054e68648c9116670d39a94fd34 (patch) | |
| tree | ac59c94bc4cf4de1b89d79e4ed030b04ff35d9da /src/Config.hs | |
| parent | 9a696c2b071dfecb691d16c66bfd00edd54c4beb (diff) | |
| download | montis-c50a8375cd37d054e68648c9116670d39a94fd34.tar.gz montis-c50a8375cd37d054e68648c9116670d39a94fd34.tar.bz2 montis-c50a8375cd37d054e68648c9116670d39a94fd34.zip | |
More flexing with the new keysM system.
Diffstat (limited to 'src/Config.hs')
| -rw-r--r-- | src/Config.hs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/Config.hs b/src/Config.hs index 9d090d6..759e3b8 100644 --- a/src/Config.hs +++ b/src/Config.hs @@ -1,5 +1,9 @@ module Config (config) where +import Control.Monad.IO.Class +import Control.Monad.Loops +import Control.Monad.RWS (MonadReader (ask)) +import qualified Wetterhorn.Core.KeyEvent as KeyEvent import Wetterhorn.Core.Keys import Wetterhorn.Core.W import Wetterhorn.Layout.Full @@ -20,6 +24,22 @@ config = bind 'l' $ wio $ putStrLn "lololololo" bind 'j' $ wio $ putStrLn "JOGGING!" + subbind (Mod1 .+ 'p') $ do + str <- + unfoldM + ( do + ke <- ask + if KeyEvent.codepoint ke == '\r' + then return Nothing + else do + Just (KeyEvent.codepoint ke) <$ nextKeyPress + ) + + liftIO $ putStrLn $ "You input: " ++ str + bind (str == "hello") $ do + liftIO $ putStrLn "You Win! *\\o/*" + liftIO $ putStrLn "You Lose :(" + forwardEvent, surfaceHook = wio . print }, |