aboutsummaryrefslogtreecommitdiff
path: root/src/Internal/KeysM.hs
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2021-11-22 17:09:47 -0700
committerJosh Rahm <rahm@google.com>2021-11-22 17:09:47 -0700
commit0c8f4b67032a6bb226665bad60417f1007cd60ee (patch)
treeecf75aabf374b27d46e8ce8a84176287b9d20d41 /src/Internal/KeysM.hs
parent245e135bf003ca9420f21dc82727a9b9b4f0bdcf (diff)
downloadrde-0c8f4b67032a6bb226665bad60417f1007cd60ee.tar.gz
rde-0c8f4b67032a6bb226665bad60417f1007cd60ee.tar.bz2
rde-0c8f4b67032a6bb226665bad60417f1007cd60ee.zip
Mess with some other keybindings.
Diffstat (limited to 'src/Internal/KeysM.hs')
-rw-r--r--src/Internal/KeysM.hs10
1 files changed, 8 insertions, 2 deletions
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 ()