summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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