From 22b5bb4358c7531885e5d136270dbebdcf261c11 Mon Sep 17 00:00:00 2001 From: Spencer Janssen Date: Thu, 1 Nov 2007 09:47:44 +0100 Subject: Port Submap darcs-hash:20071101084744-a5988-65b66876cf5f599fe90241b5c4cd8d0e41d7fbc2.gz --- Submap.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Submap.hs') diff --git a/Submap.hs b/Submap.hs index 4d655ef..b0f0a68 100644 --- a/Submap.hs +++ b/Submap.hs @@ -57,14 +57,15 @@ submap keys = do io $ grabKeyboard d root False grabModeAsync grabModeAsync currentTime - keyspec <- io $ allocaXEvent $ \p -> fix $ \nextkey -> do + (m, s) <- io $ allocaXEvent $ \p -> fix $ \nextkey -> do maskEvent d keyPressMask p KeyEvent { ev_keycode = code, ev_state = m } <- getEvent p keysym <- keycodeToKeysym d code 0 if isModifierKey keysym then nextkey - else return (cleanMask m, keysym) + else return (m, keysym) io $ ungrabKeyboard d currentTime - whenJust (M.lookup keyspec keys) id + m' <- cleanMask m + whenJust (M.lookup (m', s) keys) id -- cgit v1.2.3