aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Util
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
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 'XMonad/Util')
-rw-r--r--XMonad/Util/EZConfig.hs4
-rw-r--r--XMonad/Util/Paste.hs6
2 files changed, 8 insertions, 2 deletions
diff --git a/XMonad/Util/EZConfig.hs b/XMonad/Util/EZConfig.hs
index 299138b..aa219f8 100644
--- a/XMonad/Util/EZConfig.hs
+++ b/XMonad/Util/EZConfig.hs
@@ -27,7 +27,9 @@ module XMonad.Util.EZConfig (
-- * Emacs-style keybinding specifications
mkKeymap, checkKeymap,
- mkNamedKeymap
+ mkNamedKeymap,
+
+ parseKey -- used by XMonad.Util.Paste
) where
import XMonad
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