diff options
Diffstat (limited to 'src/Config.hs')
| -rw-r--r-- | src/Config.hs | 51 |
1 files changed, 28 insertions, 23 deletions
diff --git a/src/Config.hs b/src/Config.hs index e71f48a..5f09cbe 100644 --- a/src/Config.hs +++ b/src/Config.hs @@ -20,36 +20,41 @@ config = layout = WindowLayout Full, resetHook = do useKeysWithContinuation recordMacroContinuation $ do - kp <- nextKeyPress + ev <- nextButtonOrKeyPress - bind kp (Mod1 .+ 'q') macroKeyBind + case ev of + Right kp -> do + bind kp (Mod1 .+ 'q') macroKeyBind - bind kp (weak $ Mod1 .+ '@') replayMacroKeybind + bind kp (weak $ Mod1 .+ '@') replayMacroKeybind - bind kp (Mod1 .+ 'r') (shellExec "wofi --show run") + bind kp (Mod1 .+ 'r') (shellExec "wofi --show run") - bind kp (Shift .+ Mod1 .+ 'R') requestHotReload + bind kp (Shift .+ Mod1 .+ 'R') requestHotReload - bind kp (Mod1 .+ 't') (shellExec "alacritty") + bind kp (Mod1 .+ 't') (shellExec "alacritty") - bind kp (Mod1 .+ 'n') (return () :: W ()) + bind kp (Mod1 .+ 'n') (return () :: W ()) - bind kp (weak $ Mod1 .+ '∫') (shellExec "gxmessage hi") + bind kp (weak $ Mod1 .+ '∫') (shellExec "gxmessage hi") - bind kp (Mod1 .+ 'p') $ do - str <- - unfoldM - ( do - ke <- nextKeyPress - return $ - if KeyEvent.codepoint ke == '\r' - then Nothing - else Just (KeyEvent.codepoint ke) - ) - liftIO $ putStrLn $ "You input: " ++ str - bind kp (str == "hello") $ do - wio $ putStrLn "You Win! *\\o/*" - liftIO $ putStrLn "You lose :(" + bind kp (Mod1 .+ 'p') $ do + str <- + unfoldM + ( do + ke <- nextKeyPress + return $ + if KeyEvent.codepoint ke == '\r' + then Nothing + else Just (KeyEvent.codepoint ke) + ) + liftIO $ putStrLn $ "You input: " ++ str + bind kp (str == "hello") $ do + wio $ putStrLn "You Win! *\\o/*" + liftIO $ putStrLn "You lose :(" - forwardEvent kp + forwardEvent kp + + Left but -> + liftIO $ putStrLn $ "ButtonEvent! " ++ (show but) } |