Swap Mouse Buttons: Right-Click and Middle Click

Perm url with updates: http://xahlee.org/mswin/swap_mouse_buttons.html

Swap Mouse Buttons: Right-Click and Middle Click

Xah Lee, 2011-01-23

Another input device productivity tip: Swap your right button and middle button's actions.


“Razer Naga MMOG Laser Gaming Mouse” amazon (See: Best Mouse for Programers and AutoHotkey Keyboard Macros.)

Why you should Swap Right-Click and Middle-Click

Why? The right-click action is not much used, and middle-click is much useful. And right button is much easier to press than pressing the mouse wheel.

The right-click almost always activates a context menu. For majority of people, that's mostly used in browser, and not very often.

The mouse wheel button by default does several more useful things in all major browsers:

  • Click on a link to open it in new tab.
  • Click on a tab to close it. (no need to aim for that little X.)
  • Click on a empty spot to start auto-scroll. Useful for fast scroll (faster than mouse-wheel) and for scrolling a page sideways

How to swap right-button and middle-button?

If you have Microsoft mouse, its bundled software (IntelliPoint) can easily do that. I believe Logitech mouse also has bundled software that lets you swap easily.

Otherwise, on Windows, you can use AutoHotkey. Here's the AutoHotkey code to swap:


You can also use AutoHotkey to change the actions for the 4th and 5th buttons. See: AutoHotkey Basics.

If you don't want to spend a hour to study AutoHotkey, use paypal button below, pay $2. In the comment field, put “swap mouse buttons”. I'll email you a utility that does that. (just run it, that's all). Make sure your email address is included and correct.