From 4df5a598a5ce83bee4669fd5cc3ab6a3ef60b2fe Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Tue, 29 Mar 2022 12:06:04 -0600 Subject: Add a DSL for configuring Window-Specific bindings and move it into the Keys.hs file. --- src/Internal/KeysM.hs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/Internal/KeysM.hs') diff --git a/src/Internal/KeysM.hs b/src/Internal/KeysM.hs index f834796..dfb1429 100644 --- a/src/Internal/KeysM.hs +++ b/src/Internal/KeysM.hs @@ -28,6 +28,13 @@ class Bindable k where bind :: k -> BindingBuilder (BindableValue k) a -> BindableMonad k l () +instance Semigroup (KeysM l ()) where + (<>) = mappend + +instance Monoid (KeysM l ()) where + mempty = return () + mappend = (>>) + runKeys :: KeysM l a -> XConfig l -> Map (KeyMask, KeySym) (X ()) runKeys (KeysM stateM) config = snd $ execState stateM (config, Map.empty) -- cgit