How to make a scroll wheel macro to prevent accidental touch Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
emanate22
Posts: 52
Joined: 11 May 2021, 00:03

How to make a scroll wheel macro to prevent accidental touch

02 Jun 2022, 07:47

For example, when I press the middle button down, I don't want to trigger the scroll wheel, what command should I use? Thanks.

Code: Select all

Mbutton::
return

Mbutton up::
return

WheelDown::
;sendinput 
return

Wheelup::
;sendinput 
return
Last edited by emanate22 on 02 Jun 2022, 08:12, edited 2 times in total.
User avatar
WalkerOfTheDay
Posts: 710
Joined: 24 Mar 2016, 03:01

Re: How to make a scroll wheel macro to prevent accidental touch

02 Jun 2022, 07:52

This turns off the wheel, but keeps the MButton functional:

Code: Select all

*Wheeldown::
*Wheelup::
*Wheelleft::
*Wheelright::
return

*MButton::
MsgBox, MButton works !
return
emanate22
Posts: 52
Joined: 11 May 2021, 00:03

Re: How to make a scroll wheel macro to prevent accidental touch

02 Jun 2022, 08:15

WalkerOfTheDay wrote:
02 Jun 2022, 07:52
This turns off the wheel, but keeps the MButton functional:

Code: Select all

*Wheeldown::
*Wheelup::
*Wheelleft::
*Wheelright::
return

*MButton::
MsgBox, MButton works !
return
I want the scroll wheel to be turned off when the middle button is pressed. Because my scroll wheel is easier to accidentally touch.
User avatar
WalkerOfTheDay
Posts: 710
Joined: 24 Mar 2016, 03:01

Re: How to make a scroll wheel macro to prevent accidental touch  Topic is solved

03 Jun 2022, 07:39

This seems to be working for me:

Code: Select all

MButton::

#if getkeystate("MButton", "P") 
GetKeyState, state, MButton, P

if (state = "D")
{
	WheelDown::return
	WheelUp::return
}
#if	

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], BPet, mikeyww, peter_ahk and 120 guests