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)

1 Answer 1


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.)

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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