aboutsummaryrefslogtreecommitdiff
path: root/src/Rahm/Desktop/Keys
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2022-11-22 16:55:07 -0700
committerJosh Rahm <rahm@google.com>2022-11-22 16:55:07 -0700
commit1d4e51ff5a48dd282b94441583faec7f66e99a10 (patch)
tree559e59fa2651d39faa36cafce28e22e91e8371ef /src/Rahm/Desktop/Keys
parentdc0d5f775305536326c0ba1626ba94346f784185 (diff)
downloadrde-1d4e51ff5a48dd282b94441583faec7f66e99a10.tar.gz
rde-1d4e51ff5a48dd282b94441583faec7f66e99a10.tar.bz2
rde-1d4e51ff5a48dd282b94441583faec7f66e99a10.zip
More consistent handling with button mapping.
Button mapping is now similar in architecture to KeyMapping. As a consequence it works with the pending buffer.
Diffstat (limited to 'src/Rahm/Desktop/Keys')
-rw-r--r--src/Rahm/Desktop/Keys/Dsl.hs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/Rahm/Desktop/Keys/Dsl.hs b/src/Rahm/Desktop/Keys/Dsl.hs
index adb2668..7f06a74 100644
--- a/src/Rahm/Desktop/Keys/Dsl.hs
+++ b/src/Rahm/Desktop/Keys/Dsl.hs
@@ -21,7 +21,12 @@ data KeyBinding
type KeyBindings = Map (KeyMask, KeySym) (Documented KeyBinding)
-type ButtonBinding = Window -> X ()
+data ButtonBinding
+ = ButtonAction (Window -> X ())
+ | ButtonSubmap ButtonBindings
+ | ButtonContinuous ButtonBindings
+
+-- Window -> X ()
type ButtonBindings = Map (KeyMask, Button) ButtonBinding
@@ -52,6 +57,9 @@ class Binding k b where
rawMask :: KeyMask -> k -> BindingBuilder b ()
rawMask m x = BindingBuilder $ modify' (second ((m, toB x) :))
+instance Binding (Window -> X ()) ButtonBinding where
+ toB = ButtonAction
+
instance Binding (X ()) (Documented KeyBinding) where
toB = Documented "" . Action