From 0c8f4b67032a6bb226665bad60417f1007cd60ee Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Mon, 22 Nov 2021 17:09:47 -0700 Subject: Mess with some other keybindings. --- src/Internal/KeysM.hs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/Internal/KeysM.hs') diff --git a/src/Internal/KeysM.hs b/src/Internal/KeysM.hs index de48bee..0d7adce 100644 --- a/src/Internal/KeysM.hs +++ b/src/Internal/KeysM.hs @@ -43,8 +43,8 @@ instance HasConfig ButtonsM where getConfig = fst <$> ButtonsM get {- Generally it is assumed that the mod key shoud be pressed, but not always. -} -naked :: f -> BindingBuilder f () -naked = rawMask 0 +noMod :: f -> BindingBuilder f () +noMod = rawMask 0 rawMask :: KeyMask -> f -> BindingBuilder f () rawMask m x = BindingBuilder $ modify' (second ((m, x):)) @@ -339,6 +339,12 @@ hyperMod = maskMod hyperMask altgrMod :: f -> BindingBuilder f () altgrMod = maskMod altgrMask +{- Can combine two or more of the functions above to apply the same action to + - multiple masks. -} +(-|-) :: (f -> BindingBuilder f ()) -> + (f -> BindingBuilder f ()) -> + f -> BindingBuilder f () +(-|-) fn1 fn2 f = fn1 f >> fn2 f {- Meant for submapping, binds all alphanumeric charactes to (fn c). -} mapNumbersAndAlpha :: KeyMask -> (Char -> X ()) -> KeysM l () -- cgit