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.

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]