PgDn without having to click website first

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
ShotKey
Posts: 18
Joined: 01 Mar 2023, 07:32

PgDn without having to click website first

06 Apr 2023, 04:47

Hi,

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
But then I wanted more and came up with this code:

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
}
The the bottom of my above code snippet should do exactly the same as my top, 1st code snippet (Send {PgDn}), but instead, suddenly I have to click the website first (Send {LButton}) for it to work.

Why? And most importantly: how can I remove the need for Send {LButton} again?

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], JKJadan, peter_ahk, PuzzledGreatly and 301 guests