Use only your mouse to switch between the open applications / windows instead of the ALT + TAB shortcut without overriding the functionality of your mouse buttons.
This is a simple AHK script generated using ChatGPT, that I use regularly without even noticing it. I'm so used to this, that when I switch to other PC, my muscle memory makes me use it automatically. Then I would often realise not every PC has this script. It helped me a lot and I thought of sharing it here for others to use and modify to their needs.
- Hold the forward mouse button for 200ms.
- Scroll the mouse wheel up to tab forward through windows.
- Scroll the mouse wheel down to tab backwards.
- Release the forward mouse button to switch to the selected window.
Note: Your mouse must have a forward button for the default configuration. Refer to the Customization section to modify the trigger keys to your needs.
- Holding the forward mouse button simulates
ALTbeing held down. - Scrolling up simulates pressing
TAB. - Scrolling down simulates
SHIFT + TAB. - Releasing the forward button selects the highlighted window.
- Install AHK v1.1 (not v2.0) from their website.
- Download this repository.
- Open the
WindowTabber.ahkfile to keep running the script in the background.
Recommended: To launch automatically on startup, paste the WindowTabber.ahk file as shortcut in your startup folder:
C:\Users\[YourUsername]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
You can customize the triggers to your needs and convenience. Refer to the AHK Key List for available keys.
- Trigger Key: Replace
XButton2with another key/mouse button. - Hold Duration: Change
200in theSetTimerfunction to adjust timing. - Next Window Trigger: Replace
WheelUpwith another key/mouse button. - Previous Window Trigger: Replace
WheelDownwith another key/mouse button.
Pros
- No need to use keyboard.
- No need to override your mouse buttons functionality.
- Easy setup.
- Simple and lightweight script.
- Easy to modify to your needs.
- Works on Windows 7, 8, 10 and 11.
- Open source and free to use.
Cons
- Requires AHK to be installed.
- Only works on Windows.
- May conflict with other AHK scripts if not managed properly.
- Addictive to use.
This project is open source under the MIT License.