From 10a0cd4e7f614fb0e67a7e0e49483752c13b7642 Mon Sep 17 00:00:00 2001 From: Adam Vogt Date: Sat, 14 Nov 2009 23:37:26 +0100 Subject: Bypass more of stringToKeysym in U.Paste Ignore-this: 617c922647e9f49f5ecefa0eb1c65d3c darcs-hash:20091114223726-1499c-aac00e2ea1780619f15462df90216eba005ba8d1.gz --- XMonad/Util/Paste.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'XMonad/Util/Paste.hs') 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 -- cgit v1.2.3