Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In my .xmonad/xmonad.hs file, I have the following lines, which control howto drag and resize windows. How can I change this, such that I don't need any mod key?

myMouseBindings (XConfig {XMonad.modMask = modm}) = M.fromList $

    -- mod-button1, Set the window to floating mode and move by dragging
    [ ((modm,button1), (\w -> focus w >> mouseMoveWindow w
                                       >> windows W.shiftMaster))

    -- mod-button2, Raise the window to the top of the stack
    , ((modm,button2), (\w -> focus w >> windows W.shiftMaster))

    -- mod-button3, Set the window to floating mode and resize by dragging
    , ((modm,button3), (\w -> focus w >> mouseResizeWindow w
                                       >> windows W.shiftMaster))

    -- you may also bind events to the mouse scroll wheel (button4 and button5)
share|improve this question
up vote 2 down vote accepted

Try replacing modm with 0, e.g.

, ((0,button2), (\w -> focus w >> windows W.shiftMaster))

(see this documentation for and example modKey-less mouse binding).

But be aware that if you set a binding for (0,button1), your ordinary mouse clicks probably won't reach the GUI program anymore (I never tried it) .

Have a look at the BorderResize layout modifier, too. (Note its dependence on a floating layout etc, see the first paragraph of the linked page.)

share|improve this answer
Thanks, but you are right, my ordinary mouse clicks don't reach the GUI after changing this... – student Feb 5 '12 at 9:57
You're welcome :) – sr_ Feb 5 '12 at 10:09

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.