I wanted my 4th mouse button (brwoser back) perform scrolling down one page instead and it worked well this way (without having to left-click into the website before):
Code: Select all
XButton1:: ; 4th mouse button (browser back)
Send {PgDn}
return
Code: Select all
XButton1::
MyAHKinfo(A_LineNumber, 2000)
keywait, XButton1, t0.25
if errorlevel = 1
{
;/* ------------ Keep holding XButton1 ------------ */
; do something like e.g. browser back
return
}
; else
; keywait, XButton1, d, t0.25
; if errorlevel = 0
; {
; ;/* ------------------ Double click XButton1 ------------------- */
; do something else like e.g. go to bottom of page
; return
; }
else {
;/* ----- Normal, single XButton1 click → go page down ----- */
Send {LButton}
Send {PgDn}
return
}
Why? And most importantly: how can I remove the need for Send {LButton} again?