Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Chematronix/41baad7d38b43e2f7deed6d9691a25a7 to your computer and use it in GitHub Desktop.
Save Chematronix/41baad7d38b43e2f7deed6d9691a25a7 to your computer and use it in GitHub Desktop.
Switch between running programs with the flick of a finger: press down the Right Mouse Button and turn the mouse wheel.
; ---------------------------------------------------- ;
; Alt-Tab on Wheels (with Mouse RClick + Wheel) ;
; ---------------------------------------------------- ;
; Switch between running programs with the flick of a
; finger: press down the Right Mouse Button and turn
; the mouse wheel.
;
; Install https://www.autohotkey.com/ (Windows only) to run.
; To auto-start, copy the script or a shortcut to your
; Start Menu\Programs\Startup directory
; (%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup
; Key or button to enable alt-tabing with the wheel.
; RButton (Right Mouse Click) by default.
altTabOnWheelsModifier := "RButton"
VERSION := 1.0
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
#SingleInstance force ; Determines whether a script is allowed to run again when it is already running.
#UseHook On ; Using the keyboard hook is usually preferred for hotkeys - but here we only need the mouse hook.
#InstallMouseHook
#MaxHotkeysPerInterval 1000 ; Avoids warning messages for high speed wheel users.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
Menu, Tray, Tip, Alt-TabOnWheels %VERSION%
Menu, Tray, Icon, imageres.dll, 262
; Register altTabOnWheelsModifier + Wheel actions
Hotkey, %altTabOnWheelsModifier% & WheelUp, ShiftAltTab
Hotkey, %altTabOnWheelsModifier% & WheelDown, AltTab
; Enable altTabOnWheelsModifier when clicked by itself
Hotkey, %altTabOnWheelsModifier%, SendThisHotkey
SendThisHotkey:
Send {%A_ThisHotkey%}
Return
;Things were so simple, back in the time...
;RButton & WheelDown::AltTab
;RButton & WheelUp::ShiftAltTab
;RButton::Send {%A_ThisHotkey%}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment