Mozilla Firefox: scroll by small amounts

Post your working scripts, libraries and tools
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Mozilla Firefox: scroll by small amounts

05 Oct 2019, 01:13

- In Firefox, you can scroll by using the arrow keys.
- This script uses ctrl+shift+w/a/s/d to scroll.
- This script uses WM_MOUSEWHEEL/WM_MOUSEHWHEEL to scroll by tiny amounts. You can replace 1/-1 with greater numbers, for greater movement.
- (You can also use WM_VSCROLL/WM_HSCROLL (commented out). Unusually a non-zero number was required for the lParam. This scrolls by a similar, but smaller, distance to the arrow keys.)

Code: Select all

#IfWinActive ahk_class MozillaWindowClass

;note: tested on Firefox v69
;note: the cursor must be over the Firefox window for WM_MOUSEWHEEL/WM_MOUSEHWHEEL to work

^+w:: ;mozilla firefox - scroll up/down
PostMessage, 0x20A, 1<<16, 0,, A ;WM_MOUSEWHEEL := 0x20A
;PostMessage, 0x115, 0, 1,, A ;WM_VSCROLL := 0x115 ;SB_LINEUP := 0
return

^+s:: ;mozilla firefox - scroll up/down
PostMessage, 0x20A, -1<<16, 0,, A ;WM_MOUSEWHEEL := 0x20A
;PostMessage, 0x115, 1, 1,, A ;WM_VSCROLL := 0x115 ;SB_LINEDOWN := 1
return

^+a:: ;mozilla firefox - scroll left/right
PostMessage, 0x20E, -1<<16, 0,, A ;WM_MOUSEHWHEEL := 0x20E
;PostMessage, 0x114, 0, 1,, A ;WM_HSCROLL := 0x114 ;SB_LINELEFT := 0
return

^+d:: ;mozilla firefox - scroll left/right
PostMessage, 0x20E, 1<<16, 0,, A ;WM_MOUSEHWHEEL := 0x20E
;PostMessage, 0x114, 1, 1,, A ;WM_HSCROLL := 0x114 ;SB_LINERIGHT := 1
return

#IfWinActive
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA

Return to “Scripts and Functions”

Who is online

Users browsing this forum: Bing [Bot] and 19 guests