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 <joshuarahm@gmail.com>2022-10-09 12:19:45 -0600
commit36af79c4549cd8b491bc127a8034cbaee5fe50f8 (patch)
treeb67863606e8cac94550bddef8323d0c01cb84805 /src/Internal/KeysM.hs
parent325fc6952238f58260e570f3d2a4196b503ecbae (diff)
downloadrde-36af79c4549cd8b491bc127a8034cbaee5fe50f8.tar.gz
rde-36af79c4549cd8b491bc127a8034cbaee5fe50f8.tar.bz2
rde-36af79c4549cd8b491bc127a8034cbaee5fe50f8.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 ()