How to stop the pass-through of mouse scroll

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
shanshans
Posts: 27
Joined: 13 Dec 2015, 08:10

How to stop the pass-through of mouse scroll

Post by shanshans » 24 Nov 2021, 12:26

If you remap keys like A::B , most of the software will treat a as B when you pressed a.

But if you remap some key like mouse scroll (up/down) :: B , the software(not every) will output scroll up/down first then B when you scrolled the the mouse.

Is that a way to only give the output of B just like the keyboard remapping?

THK :)

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

Re: How to stop the pass-through of mouse scroll

Post by mikeyww » 24 Nov 2021, 12:58

I had no such trouble.

Code: Select all

WheelUp::b

User avatar
SirSocks
Posts: 360
Joined: 26 Oct 2018, 08:14

Re: How to stop the pass-through of mouse scroll

Post by SirSocks » 24 Nov 2021, 13:02

Try this....

Code: Select all

#NoEnv
SendMode Input
#Persistent
#MaxHotkeysPerInterval 99000000
#SingleInstance Force
Process, Priority, , A
return

WheelUp::
if (A_PriorHotkey != A_ThisHotkey or A_TimeSincePriorHotkey > 50)
	{
	send, a
	return
	}
return

Esc::
ExitApp

shanshans
Posts: 27
Joined: 13 Dec 2015, 08:10

Re: How to stop the pass-through of mouse scroll

Post by shanshans » 24 Nov 2021, 14:31

Doesn't work for me but thk. As far as i know , key like ctrl , any key from gamepad/joystick will pass-through itself by default ... Maybe it is what it is ... :?

lexikos
Posts: 9560
Joined: 30 Sep 2013, 04:07
Contact:

Re: How to stop the pass-through of mouse scroll

Post by lexikos » 26 Nov 2021, 22:18

As far as i know , key like ctrl , any key from gamepad/joystick will pass-through itself by default
Ctrl:: and other neutral modifiers may not be blocked, as a special case, but LCtrl:: and RCtrl:: will block.

Gamepad/joystick input is handled very differently to keyboard and mouse input. It is detected by polling, like calling GetKeyState repeatedly on a timer. There is no way to block it.

Mouse input is detected through the mouse hook. WheelUp::b most certainly blocks by default, but AutoHotkey's mouse hook may be unable to block input to other programs which detect input using a mouse hook or lower level methods.

Post Reply

Return to “Ask for Help (v1)”