aboutsummaryrefslogtreecommitdiff
path: root/src/Rahm/Desktop/Keys
diff options
context:
space:
mode:
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