diff options
| author | Josh Rahm <rahm@google.com> | 2022-03-29 12:06:04 -0600 |
|---|---|---|
| committer | Josh Rahm <rahm@google.com> | 2022-03-29 12:06:04 -0600 |
| commit | 8678e0b8e6e2d25db7eebf2a90c78687530eb711 (patch) | |
| tree | a1a31bb97c7f976e64f9d420b6a92f12440e51ec /src/Internal/KeysM.hs | |
| parent | 685d67d19d2e94fc94ed7334e5e7ab19454426d7 (diff) | |
| download | rde-8678e0b8e6e2d25db7eebf2a90c78687530eb711.tar.gz rde-8678e0b8e6e2d25db7eebf2a90c78687530eb711.tar.bz2 rde-8678e0b8e6e2d25db7eebf2a90c78687530eb711.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.hs | 7 |
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) |