aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Util/Paste.hs
diff options
context:
space:
mode:
authorAdam Vogt <vogt.adam@gmail.com>2009-11-14 23:37:26 +0100
committerAdam Vogt <vogt.adam@gmail.com>2009-11-14 23:37:26 +0100
commit10a0cd4e7f614fb0e67a7e0e49483752c13b7642 (patch)
tree5aec4025cafcf8ba1ff5adbcec6875f87941ac95 /XMonad/Util/Paste.hs
parentdfb15478f05280486f694ffc648d0f6b12670f6f (diff)
downloadXMonadContrib-10a0cd4e7f614fb0e67a7e0e49483752c13b7642.tar.gz
XMonadContrib-10a0cd4e7f614fb0e67a7e0e49483752c13b7642.tar.xz
XMonadContrib-10a0cd4e7f614fb0e67a7e0e49483752c13b7642.zip
Bypass more of stringToKeysym in U.Paste
Ignore-this: 617c922647e9f49f5ecefa0eb1c65d3c darcs-hash:20091114223726-1499c-aac00e2ea1780619f15462df90216eba005ba8d1.gz
Diffstat (limited to '')
-rw-r--r--XMonad/Util/Paste.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/XMonad/Util/Paste.hs b/XMonad/Util/Paste.hs
index ac7358b..d6a5467 100644
--- a/XMonad/Util/Paste.hs
+++ b/XMonad/Util/Paste.hs
@@ -28,8 +28,11 @@ import Graphics.X11.Xlib.Extras (none, setEventType, setKeyEvent)
import Control.Monad.Reader (asks)
import XMonad.Operations (withFocused)
import Data.Char (isUpper)
+import Data.Maybe (listToMaybe)
import Graphics.X11.Xlib.Misc (stringToKeysym)
import XMonad.Util.XSelection (getSelection)
+import XMonad.Util.EZConfig (parseKey)
+import Text.ParserCombinators.ReadP (readP_to_S)
{- $usage
@@ -70,7 +73,8 @@ pasteString = mapM_ (\x -> if isUpper x then pasteChar shiftMask x else pasteCha
have trouble with any 'Char' outside ASCII.
-}
pasteChar :: KeyMask -> Char -> X ()
-pasteChar m c = sendKey m $ stringToKeysym [c]
+pasteChar m c = sendKey m $ maybe (stringToKeysym [c]) fst
+ $ listToMaybe $ readP_to_S parseKey [c]
sendKey :: KeyMask -> KeySym -> X ()
sendKey = (withFocused .) . sendKeyWindow