summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDon Stewart <dons@cse.unsw.edu.au>2007-03-09 14:42:11 +0100
committerDon Stewart <dons@cse.unsw.edu.au>2007-03-09 14:42:11 +0100
commit0d4204ae83a580edbdb3d953559ef1436c490aa9 (patch)
treed257d511765cc5d680072e9fdb61fc211e0b694e
parent27b1bcc97eb5893c38bfe5593a9e4661cc003994 (diff)
downloadmetatile-0d4204ae83a580edbdb3d953559ef1436c490aa9.tar
metatile-0d4204ae83a580edbdb3d953559ef1436c490aa9.zip
improved grabkeys (also handle lockMask down)
darcs-hash:20070309134211-9c5c1-9042f5565486839b596000cdc12252cde2c8c167
-rw-r--r--Main.hs11
1 files changed, 8 insertions, 3 deletions
diff --git a/Main.hs b/Main.hs
index edade6f..3819ea3 100644
--- a/Main.hs
+++ b/Main.hs
@@ -94,9 +94,14 @@ main = do
-- | Grab the keys back
grabKeys :: Display -> Window -> W ()
-grabKeys dpy r = forM_ (M.keys keys) $ \(m,s) -> io $ do
- kc <- keysymToKeycode dpy s
- grabKey dpy kc m r True grabModeAsync grabModeAsync
+grabKeys dpy root = do
+ io $ ungrabKey dpy '\0' {-AnyKey-} anyModifier root
+ forM_ (M.keys keys) $ \(mask,s) -> io $ do
+ kc <- keysymToKeycode dpy s
+ let grab m = grabKey dpy kc m root True grabModeAsync grabModeAsync
+ grab mask
+ grab (mask .|. lockMask)
+ -- no numlock
-- ---------------------------------------------------------------------
-- Event handler