aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Util/Paste.hs
diff options
context:
space:
mode:
authorgwern0 <gwern0@gmail.com>2008-09-27 01:20:56 +0200
committergwern0 <gwern0@gmail.com>2008-09-27 01:20:56 +0200
commit03fef93a28ee68b36beaba8257d60decd4a9bb75 (patch)
tree086ced88f025dc4bb740eefed7e581d73eb0b9e2 /XMonad/Util/Paste.hs
parent409862b6e640a0595fff9096bd14f2f8cf751cd7 (diff)
downloadXMonadContrib-03fef93a28ee68b36beaba8257d60decd4a9bb75.tar.gz
XMonadContrib-03fef93a28ee68b36beaba8257d60decd4a9bb75.tar.xz
XMonadContrib-03fef93a28ee68b36beaba8257d60decd4a9bb75.zip
Paste.hs: implement noModMask suggestion
darcs-hash:20080926232056-f7719-35b3e9a6103a1b2b014ae4d2b490b9e993a960cf.gz
Diffstat (limited to 'XMonad/Util/Paste.hs')
-rw-r--r--XMonad/Util/Paste.hs10
1 files changed, 7 insertions, 3 deletions
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