aboutsummaryrefslogtreecommitdiff
path: root/src/Internal/KeysM.hs
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2022-03-29 12:06:04 -0600
committerJosh Rahm <joshuarahm@gmail.com>2022-10-09 12:19:45 -0600
commit4df5a598a5ce83bee4669fd5cc3ab6a3ef60b2fe (patch)
treea1a31bb97c7f976e64f9d420b6a92f12440e51ec /src/Internal/KeysM.hs
parentc75c5f8254181242a96f3f6652a53cc70f40b13e (diff)
downloadrde-4df5a598a5ce83bee4669fd5cc3ab6a3ef60b2fe.tar.gz
rde-4df5a598a5ce83bee4669fd5cc3ab6a3ef60b2fe.tar.bz2
rde-4df5a598a5ce83bee4669fd5cc3ab6a3ef60b2fe.zip
Add a DSL for configuring Window-Specific bindings and move it into the Keys.hs file.
Diffstat (limited to 'src/Internal/KeysM.hs')
-rw-r--r--src/Internal/KeysM.hs7
1 files changed, 7 insertions, 0 deletions
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)