SEARCH

How-To Geek

How to Fake Back and Forward Buttons With a Three-button Mouse

image

If you’re stuck using a three-button mouse, this doesn’t mean you have to give up on the comfort of Back and Forward browser buttons. Using a simple AutoHotkey script, you could set your mouse up so that you can hold the right mouse button and scroll the wheel to emulate these all-important buttons.

Getting The Script

First of all, here’s the script itself. You can just copy/paste these lines into a local AHK file and run it by double-clicking on the script file.

#IfWinNotActive Total Commander
RButton::click right
RButton & WheelDown::Send {Browser_Back}
RButton & WheelUp::Send {Browser_Forward}
#IfWinNotActive

Of course, you could also add this code to an existing AutoHotkey script if you want.

Understanding The Script

When you use a piece of code like this, it’s always nice to understand what it does so you can customize it. In this case, the first line excludes Total Commander; this is because Total Commander makes a distinction between short right clicks (for selecting files) and long right clicks (for showing a context menu). If you don’t use Total Commander, you can simply drop the first and last lines.

As for the other three lines: RButton::click right preserves the original functionality of the right click. Without this line, right clicking would have no effect across your system. The remaining two lines emulate the back and forward buttons. On our test system, each “click” of the scroll wheel fired exactly one button press, so the tactile feedback was quite effective.

Extending The Script

Using this same principle, you could take the code from our recent post showing how to change a window’s opacity using a hotkey and tweak it so that holding the left mouse button while scrolling the wheel would make the active window more transparent. If you need a hint on how to do this, let us know and we’ll show you in the comments.

[Photo: iwd]

A technical writer for Tibbo Technology by day, Erez is obsessed with customizing anything and everything. After years of using Litestep and Blackbox, switching to a custom keyboard layout (Colemak), extending Word and Excel with elaborate VBA, losing weight with an AutoHotkey script he developed and spending countless hours tweaking Foobar2000 to get it to look "just right", Erez decided the time has come to share some of this obsession with the world at large.

  • Published 03/9/11

Comments (8)

  1. Ja5087

    Anything to enable middle click on a logitech mouse that gives up middle click for hyper scroll switching?

  2. Ben Jolin

    I love the tip. I do engineering and It could bring so much functionality to my mousetip. Alas, I’m not geeky enough to understand what an AHK file is, where to find it, or what to do with it. A step by step would have been better.

  3. John

    I tried but didn’t do anything. No program to execute that file. I copied text and pasted to text document and saved as .ahk file but didn’t work.

  4. Jari

    AHK means AutoHotKey…here’s a web site that offers several free utilities:
    http://www.autohotkey.com/download/

  5. Chad

    You have to download and install AutoHotkey from the link above. Then you can create the script and then convert it to a executable (.exe).

  6. BAF

    @Ja5087 – what mouse? My MX Revolution does that by default (IIRC), but installing the SetPoint drivers gives you the option to reclaim middle click right from Logitech themselves, no third party apps needed.

  7. poorgeek

    Only works with M$ Windows. Doesn’t do anything in Autokey (http://code.google.com/p/autokey/) for Linux.

  8. Kryten

    Seems that this script breaks the Windows 7 Shift-Right-Click Context Menu…

Get Free Articles in Your Inbox!

Join 134,000 newsletter readers

Email:

Go check your email!