Horizontal scroll hotkey help?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Brop
Posts: 2
Joined: 30 Jan 2023, 10:02

Horizontal scroll hotkey help?

Post by Brop » 30 Jan 2023, 10:12

I'm using the below to modify mouse scrolling with shift to a fast sidescroll. The problem I have is it also scrolls up and down slightly as well. Any ideas how to block the up and down scroll when it's side scrolling?

Thanks

Code: Select all

+WheelDown::
Loop 6
Send {WheelRight}{WheelRight}
+WheelUp::
Loop 6
Send {WheelLeft}{WheelLeft}
Return

User avatar
mikeyww
Posts: 26857
Joined: 09 Sep 2014, 18:38

Re: Horizontal scroll hotkey help?

Post by mikeyww » 30 Jan 2023, 11:34

Welcome to this AutoHotkey forum!

Code: Select all

#Requires AutoHotkey v1.1.33
+WheelDown::SendInput {WheelRight 12}
+WheelUp::SendInput {WheelLeft 12}

Code: Select all

#Requires AutoHotkey v2.0
+WheelDown::Send '{WheelRight 12}'
+WheelUp::Send '{WheelLeft 12}'

Brop
Posts: 2
Joined: 30 Jan 2023, 10:02

Re: Horizontal scroll hotkey help?

Post by Brop » 30 Jan 2023, 12:07

mikeyww wrote:
30 Jan 2023, 11:34
Welcome to this AutoHotkey forum!

Code: Select all

#Requires AutoHotkey v1.1.33
+WheelDown::SendInput {WheelRight 12}
+WheelUp::SendInput {WheelLeft 12}

Code: Select all

#Requires AutoHotkey v2.0
+WheelDown::Send '{WheelRight 12}'
+WheelUp::Send '{WheelLeft 12}'
Thanks :)

iseahound
Posts: 1444
Joined: 13 Aug 2016, 21:04
Contact:

Re: Horizontal scroll hotkey help?

Post by iseahound » 30 Jan 2023, 13:24

This makes it work in explorer as well:

Code: Select all

#Requires AutoHotkey v2.0

; Horizontal Scroll

#WheelUp::              Send '{Blind}{WheelLeft}'
#WheelDown::            Send '{Blind}{WheelRight}'

#HotIf WinGetClass((MouseGetPos(,, &hwnd), hwnd)) = "CabinetWClass"
#WheelUp::              (_ := (n) => ((n < 0) || (PostMessage(0x114, 0,, "ScrollBar1", (MouseGetPos(,, &hwnd), hwnd)), _(n-1))))(6)
#WheelDown::            (_ := (n) => ((n < 0) || (PostMessage(0x114, 1,, "ScrollBar1", (MouseGetPos(,, &hwnd), hwnd)), _(n-1))))(6)
#HotIf

Post Reply

Return to “Ask for Help (v1)”