[xmonad] Re: Passing ModMask inputs to application

Ben Boeckel mathstuf at gmail.com
Mon Oct 4 19:09:49 EDT 2010


Wei Hu <wei.hoo at gmail.com> wrote:
> Hi,
> 
> I'm using NX to connect to a remote Linux box, and both machines are
> running XMonad. How can I tell XMonad to pass every keyboard/mouse
> input to the remote desktop? In other words, I would like the remote
> desktop to "grab" my inputs, like the way VMWare and Remote Desktop
> work on Windows.
> 
> Thanks,
> Wei

Putting the application into "Full screen" mode is the only way really.
I run XMonad with an "escape key" (ctrl-i) which prefixes most of
XMonad's bindings. Other than making a copy of the bindings under an
escape key, I'm not sure how it would be done. Heres a possible
(untested) solution to avoid using submap for local commands:

    import XMonad.Actions.Submap -- for submap
    import XMonad.Util.Paste     -- for sendKey

    myKeys = M.fromList $ [...]
    myEscapedKeys = M.fromList [((prefixMask, prefixKey), submap . mkKeys myKeys)]
        where
            mkKeys keys = M.MapWithKey (\(m, k) _ -> sendKey m k) keys
    allKeys = M.union myKeys myEscapedKeys

Hope this helps.

--Ben



More information about the xmonad mailing list