From ac30d214a5eb686b5559dc7cf7cf7bd2973f8cde Mon Sep 17 00:00:00 2001 From: gwern0 Date: Sat, 27 Sep 2008 17:01:58 +0200 Subject: Paste.hs: improve haddocks darcs-hash:20080927150158-f7719-ec39026e096874f51eb4b44e4c04ead2e29bea53.gz --- XMonad/Util/Paste.hs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'XMonad/Util/Paste.hs') diff --git a/XMonad/Util/Paste.hs b/XMonad/Util/Paste.hs index 321eb99..ac7358b 100644 --- a/XMonad/Util/Paste.hs +++ b/XMonad/Util/Paste.hs @@ -1,10 +1,9 @@ {- | Module : XMonad.Util.Paste -Author : Jérémy Bobbio -Copyright : (C) 2008 +Copyright : (C) 2008 Jérémy Bobbio, gwern License : BSD3 -Maintainer : +Maintainer : gwern Stability : unstable Portability : unportable @@ -36,9 +35,9 @@ import XMonad.Util.XSelection (getSelection) Import this module into your xmonad.hs as usual: -> import XMonad.Util.XPaste +> import XMonad.Util.Paste -And use the functions. They all return "X ()", and so are appropriate +And use the functions. They all return 'X' (), and so are appropriate for use as keybindings. Example: > , ((m, xK_d), pasteString "foo bar") ] @@ -52,7 +51,7 @@ texts. pasteSelection :: X () pasteSelection = getSelection >>= pasteString --- | Send a string to the window with current focus. This function correctly +-- | Send a string to the window which is currently focused. This function correctly -- handles capitalization. pasteString :: String -> X () pasteString = mapM_ (\x -> if isUpper x then pasteChar shiftMask x else pasteChar noModMask x) @@ -68,7 +67,7 @@ pasteString = mapM_ (\x -> if isUpper x then pasteChar shiftMask x else pasteCha > pasteChar shiftMask 'F' Note that this function makes use of 'stringToKeysym', and so will probably - have trouble with any Char outside ASCII. + have trouble with any 'Char' outside ASCII. -} pasteChar :: KeyMask -> Char -> X () pasteChar m c = sendKey m $ stringToKeysym [c] @@ -76,6 +75,7 @@ pasteChar m c = sendKey m $ stringToKeysym [c] sendKey :: KeyMask -> KeySym -> X () sendKey = (withFocused .) . sendKeyWindow +-- | The primitive. Allows you to send any combination of 'KeyMask' and 'KeySym' to any 'Window' you specify. sendKeyWindow :: KeyMask -> KeySym -> Window -> X () sendKeyWindow mods key w = withDisplay $ \d -> do rootw <- asks theRoot @@ -88,6 +88,7 @@ sendKeyWindow mods key w = withDisplay $ \d -> do 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