diff options
author | gwern0 <gwern0@gmail.com> | 2008-09-27 17:01:58 +0200 |
---|---|---|
committer | gwern0 <gwern0@gmail.com> | 2008-09-27 17:01:58 +0200 |
commit | ac30d214a5eb686b5559dc7cf7cf7bd2973f8cde (patch) | |
tree | b2e67aea61fa9b809af975c285b57089f422a50e | |
parent | 400742d44c70bfc307acff6c746cc573fc18eaa2 (diff) | |
download | XMonadContrib-ac30d214a5eb686b5559dc7cf7cf7bd2973f8cde.tar.gz XMonadContrib-ac30d214a5eb686b5559dc7cf7cf7bd2973f8cde.tar.xz XMonadContrib-ac30d214a5eb686b5559dc7cf7cf7bd2973f8cde.zip |
Paste.hs: improve haddocks
darcs-hash:20080927150158-f7719-ec39026e096874f51eb4b44e4c04ead2e29bea53.gz
-rw-r--r-- | XMonad/Util/Paste.hs | 15 |
1 files changed, 8 insertions, 7 deletions
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 : <gwern0@gmail.com> +Maintainer : gwern <gwern0@gmail.com> 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 |