Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save replete/9be1ac530503168636536ddf0ccc7463 to your computer and use it in GitHub Desktop.
Save replete/9be1ac530503168636536ddf0ccc7463 to your computer and use it in GitHub Desktop.
AutoHotkey - Browser Gestures (Swipe left/right navigate back/forward, middle-click like firefox)
GroupAdd, Browsers, ahk_class Chrome_WidgetWin_1
GroupAdd, Browsers, ahk_class MozillaWindowClass
GroupAdd, Browsers, ahk_class ApplicationFrameWindow
#MaxHotkeysPerInterval 219
;-----three finger tap for middle click-----
+^#F22::
SendInput, {MButton}
return
#IfWinActive ahk_group Browsers
;-----four finger tap for browser tab switching-----
+^#F24::SendInput, {ctrldown}{tab}{ctrlup}
return
;-----swipe left for backward navigation-----
WheelLeft::
winc_pressesL += 1
SetTimer, Whleft, 50
return
Whleft:
SetTimer, Whleft, off
if winc_pressesL >= 5
{
SendInput, {Browser_Back}
}
winc_pressesL = 0
return
;-----swipe right for forward navigation-----
WheelRight::
winc_pressesR += 1
SetTimer, WhRight, 50
return
Whright:
SetTimer, Whright, off
if winc_pressesR >= 5
{
SendInput, {Browser_Forward}
}
winc_pressesR = 0
return
#IfWinActive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment