aboutsummaryrefslogtreecommitdiff
path: root/src/Internal
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2022-03-29 14:30:17 -0600
committerJosh Rahm <rahm@google.com>2022-03-29 14:30:17 -0600
commit88e467e808e5ebec0d7dc963f1c6aeb2fea26ad4 (patch)
tree3c0cf1b418651ac297ab0978e06418881b59459e /src/Internal
parentbfb70428f7791000239ac1d90635677ff577fee7 (diff)
downloadrde-88e467e808e5ebec0d7dc963f1c6aeb2fea26ad4.tar.gz
rde-88e467e808e5ebec0d7dc963f1c6aeb2fea26ad4.tar.bz2
rde-88e467e808e5ebec0d7dc963f1c6aeb2fea26ad4.zip
--amend
Diffstat (limited to 'src/Internal')
-rw-r--r--src/Internal/Keys.hs31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/Internal/Keys.hs b/src/Internal/Keys.hs
index ce48dfd..49b85d1 100644
--- a/src/Internal/Keys.hs
+++ b/src/Internal/Keys.hs
@@ -494,6 +494,7 @@ windowSpecificBindings config = do
w <- lift ask
let configureIf b k = tell =<< lift (b --> return (runKeys k config))
+ emitKey = flip sendKey w
configureIf (flip elem browsers <$> className) $ do
@@ -521,46 +522,46 @@ windowSpecificBindings config = do
let mods = permuteMods [shiftMask, controlMask, 0]
bind xK_h $ do
- rawMask controlMask $ sendKey (0, xK_BackSpace) w
+ rawMask controlMask $ emitKey (0, xK_BackSpace)
forM_ mods $ \mask ->
- rawMask (altMask .|. mask) $ sendKey (mask, xK_Left) w
+ rawMask (altMask .|. mask) $ emitKey (mask, xK_Left)
bind xK_j $
forM_ mods $ \mask ->
- rawMask (altMask .|. mask) $ sendKey (mask, xK_Down) w
+ rawMask (altMask .|. mask) $ emitKey (mask, xK_Down)
bind xK_k $
forM_ mods $ \mask ->
- rawMask (altMask .|.mask) $ sendKey (mask, xK_Up) w
+ rawMask (altMask .|.mask) $ emitKey (mask, xK_Up)
bind xK_l $
forM_ mods $ \mask ->
- rawMask (altMask .|. mask) $ sendKey (mask, xK_Right) w
+ rawMask (altMask .|. mask) $ emitKey (mask, xK_Right)
bind xK_u $
- rawMask controlMask $ sendKey (controlMask .|. shiftMask, xK_BackSpace) w
+ rawMask controlMask $ emitKey (controlMask .|. shiftMask, xK_BackSpace)
bind xK_w $
- rawMask controlMask $ sendKey (controlMask, xK_BackSpace) w
+ rawMask controlMask $ emitKey (controlMask, xK_BackSpace)
bind xK_b $ do
- rawMask controlMask $ sendKey (controlMask, xK_Left) w
+ rawMask controlMask $ emitKey (controlMask, xK_Left)
rawMask (controlMask .|. shiftMask) $
- sendKey (controlMask .|. shiftMask, xK_Left) w
+ emitKey (controlMask .|. shiftMask, xK_Left)
bind xK_e $ do
- rawMask controlMask $ sendKey (controlMask, xK_Right) w
+ rawMask controlMask $ emitKey (controlMask, xK_Right)
rawMask (controlMask .|. shiftMask) $
- sendKey (controlMask .|. shiftMask, xK_Right) w
+ emitKey (controlMask .|. shiftMask, xK_Right)
bind xK_dollar $
- rawMask controlMask $ sendKey (0, xK_End) w
+ rawMask controlMask $ emitKey (0, xK_End)
bind xK_at $
- rawMask (controlMask .|. shiftMask) $ sendKey (0, xK_Home) w
+ rawMask (controlMask .|. shiftMask) $ emitKey (0, xK_Home)
bind xK_d $
- rawMask controlMask $ sendKey (controlMask, xK_w) w
+ rawMask controlMask $ emitKey (controlMask, xK_w)
bind xK_F2 $
-- Experimental.
@@ -569,7 +570,7 @@ windowSpecificBindings config = do
-- Add a binding to xev as a test.
configureIf (title =? "Event Tester") $
bind xK_F2 $
- noMod $ sendKey (controlMask, xK_F2) w
+ noMod $ emitKey (controlMask, xK_F2)
where
browsers = ["Google-chrome", "Brave-browser", "firefox-default"]