#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. ; #Warn ; Enable warnings to assist with detecting common errors. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. RButton:: RButtonCount++ if RButtonCount=1 SetTimer,CheckR,-1000 if RButtonCount=1 KeyWait,RButton,U,T0.8 if ErrorLevel RButtonCount1:=1 else { KeyWait,RButton,D,T0.1 if ErrorLevel RButtonCount1:=2 else { RButtonCount++ RButtonCount1:=3 } } if RButtonCount1=1 Menu, tray, Show else if RButtonCount1=2 Send {RButton} else if RButtonCount1=3 Send ^v if (RButtonCount1=1 || RButtonCount1=3) gosub,RCount Return RCount: RButtonCount:=0 RButtonCount1:=0 return CheckR: if (RButtonCount=1 && RButtonCount1=2) gosub,RCount return