Making a key perform mouse wheel scrolling

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
theridon
Posts: 2
Joined: 03 Jan 2021, 16:11

Making a key perform mouse wheel scrolling

Post by theridon » 03 Jan 2021, 16:18

I have severe hand disabilities and am not able to scroll the mouse wheel but some programs require it. I looked around the web but could not find something that can specifically do this: When I press a key (once), it scrolls the mouse wheel either up or down a set amount (let's say a few times). Please advise. Thank you!

User avatar
Epialis
Posts: 858
Joined: 02 Aug 2020, 22:44

Re: Making a key perform mouse wheel scrolling

Post by Epialis » 03 Jan 2021, 16:25

Code: Select all

f1::
send {WheelDown 1}
return

f2::
send {WheelUp 1}
return
Just hold the key down to continuous scroll

theridon
Posts: 2
Joined: 03 Jan 2021, 16:11

Re: Making a key perform mouse wheel scrolling

Post by theridon » 03 Jan 2021, 19:15

Epialis wrote:
03 Jan 2021, 16:25

Code: Select all

f1::
send {WheelDown 1}
return

f2::
send {WheelUp 1}
return
Just hold the key down to continuous scroll
How can I make it scroll for a few seconds by only pressing the key once? I don't want to have to continuously press on the key.

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

Re: Making a key perform mouse wheel scrolling

Post by mikeyww » 03 Jan 2021, 20:40

Code: Select all

F1::
Loop, 20 {
 Send {WheelDown}
 Sleep, 100
}
Return

arbibarbarona
Posts: 63
Joined: 05 May 2021, 10:19

Re: Making a key perform mouse wheel scrolling

Post by arbibarbarona » 17 May 2022, 21:11

Code: Select all

F14::
Loop, 20 {
 Send {WheelDown}
 Sleep, 100
}
Return
Hi Mike how can I hold down the key to send loop Wheeldown and stop when I lift up and not scroll down all though out?

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

Re: Making a key perform mouse wheel scrolling

Post by mikeyww » 17 May 2022, 21:17

Code: Select all

F14::WheelDown
Or:

Code: Select all

F14::
While GetKeyState("F14", "P") {
 Send {WheelDown}
 Sleep, 30
}
Return

Rohwedder
Posts: 7551
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Making a key perform mouse wheel scrolling

Post by Rohwedder » 18 May 2022, 03:57

Hallo,
try:

Code: Select all

#InstallKeybdHook
#InstallMouseHook
~LCtrl::MouseGetPos,, y1
~LCtrl Up::
While, (A_TimeIdleMouse < 500) And (A_PriorKey = "LControl")
{
	MouseGetPos,, y2
	IF (y2-y1 > 25)
		Send, {WheelUp}
	Else IF (y1-y2 > 25)
		Send, {WheelDown}
	Sleep, 100
}
Return
Press LCtrl ( =down position), move the mouse down or up and release LCtrl. Then WheelUps or WheelDowns are sent depending on the position of the mouse relative to the down position until the mouse is not moved for 1/2 second.

Post Reply

Return to “Ask for Help (v1)”