diff options
Diffstat (limited to 'XMonad')
-rw-r--r-- | XMonad/Util/EZConfig.hs | 4 | ||||
-rw-r--r-- | XMonad/Util/Paste.hs | 6 |
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 |