From 03fef93a28ee68b36beaba8257d60decd4a9bb75 Mon Sep 17 00:00:00 2001 From: gwern0 Date: Sat, 27 Sep 2008 01:20:56 +0200 Subject: Paste.hs: implement noModMask suggestion darcs-hash:20080926232056-f7719-35b3e9a6103a1b2b014ae4d2b490b9e993a960cf.gz --- XMonad/Util/Paste.hs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'XMonad/Util/Paste.hs') diff --git a/XMonad/Util/Paste.hs b/XMonad/Util/Paste.hs index e5c65e6..36399e0 100644 --- a/XMonad/Util/Paste.hs +++ b/XMonad/Util/Paste.hs @@ -23,7 +23,6 @@ import Data.Char (isUpper) import Graphics.X11.Xlib.Misc (stringToKeysym) import XMonad.Util.XSelection (getSelection) - {- $usage Import this module into your xmonad.hs as usual: @@ -47,7 +46,7 @@ pasteSelection = getSelection >>= pasteString -- | Send a string to the window with current focus. This function correctly -- handles capitalization. pasteString :: String -> X () -pasteString = mapM_ (\x -> if isUpper x then pasteChar shiftMask x else pasteChar 0 x) +pasteString = mapM_ (\x -> if isUpper x then pasteChar shiftMask x else pasteChar noModMask x) {- | Send a character to the current window. This is more low-level. Remember that you must handle the case of capitalization appropriately. @@ -77,4 +76,9 @@ sendKeyWindow mods key w = withDisplay $ \d -> do setKeyEvent ev w rootw none mods keycode True sendEvent d w True keyPressMask ev setEventType ev keyRelease - sendEvent d w True keyReleaseMask ev \ No newline at end of file + sendEvent d w True keyReleaseMask ev + +-- | A null 'KeyMask'. Used when you don't want a character or string shifted, control'd, or what. +-- TODO: This really should be a function in the X11 binding. When noModMask shows up there, remove. +noModMask :: KeyMask +noModMask = 0 -- cgit v1.2.3