aboutsummaryrefslogtreecommitdiff
path: root/src/Internal/RebindKeys.hs
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2022-03-28 11:52:34 -0600
committerJosh Rahm <joshuarahm@gmail.com>2022-10-09 12:19:45 -0600
commit0762cb0962e269caa70d5aa6c012a2a3fc1140c9 (patch)
treeb9621342d9f16d25ce9ae2fdc1929934e4f8931e /src/Internal/RebindKeys.hs
parentc8e3f7627115603cb794deb47505b0506baad7b0 (diff)
downloadrde-0762cb0962e269caa70d5aa6c012a2a3fc1140c9.tar.gz
rde-0762cb0962e269caa70d5aa6c012a2a3fc1140c9.tar.bz2
rde-0762cb0962e269caa70d5aa6c012a2a3fc1140c9.zip
Add (some) ability to send keys to other windows
Diffstat (limited to 'src/Internal/RebindKeys.hs')
-rw-r--r--src/Internal/RebindKeys.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Internal/RebindKeys.hs b/src/Internal/RebindKeys.hs
index 22b0165..7c5d47c 100644
--- a/src/Internal/RebindKeys.hs
+++ b/src/Internal/RebindKeys.hs
@@ -91,6 +91,12 @@ remapKey keyFrom action = do
XS.modify $ \(RemapState (NoPersist keyMap)) -> RemapState $ NoPersist $
Map.insert (window, keyFrom) action keyMap
+-- sendKey, but as a query.
+sendKeyQ :: (KeyMask, KeySym) -> Query ()
+sendKeyQ key = do
+ win <- ask
+ liftX (sendKey key win)
+
sendKey :: (KeyMask, KeySym) -> Window -> X ()
sendKey (keymask, keysym) w = do
XConf { display = disp, theRoot = rootw } <- ask