diff options
author | Don Stewart <dons@cse.unsw.edu.au> | 2007-03-09 14:42:11 +0100 |
---|---|---|
committer | Don Stewart <dons@cse.unsw.edu.au> | 2007-03-09 14:42:11 +0100 |
commit | 0d4204ae83a580edbdb3d953559ef1436c490aa9 (patch) | |
tree | d257d511765cc5d680072e9fdb61fc211e0b694e | |
parent | 27b1bcc97eb5893c38bfe5593a9e4661cc003994 (diff) | |
download | metatile-0d4204ae83a580edbdb3d953559ef1436c490aa9.tar metatile-0d4204ae83a580edbdb3d953559ef1436c490aa9.zip |
improved grabkeys (also handle lockMask down)
darcs-hash:20070309134211-9c5c1-9042f5565486839b596000cdc12252cde2c8c167
-rw-r--r-- | Main.hs | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -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 |