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 <rahm@google.com>2022-03-28 11:52:34 -0600
commitd15ea771e45b60f32c83bfd90386c60d192299c0 (patch)
treeb9621342d9f16d25ce9ae2fdc1929934e4f8931e /src/Internal/RebindKeys.hs
parentb8bb40af61fbbf1c13c4556832055304109311db (diff)
downloadrde-d15ea771e45b60f32c83bfd90386c60d192299c0.tar.gz
rde-d15ea771e45b60f32c83bfd90386c60d192299c0.tar.bz2
rde-d15ea771e45b60f32c83bfd90386c60d192299c0.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