AHK: scroling lmb

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Wladiskowacz
Posts: 3
Joined: 23 Jan 2022, 09:48

AHK: scroling lmb

Post by Wladiskowacz » 23 Jan 2022, 10:02

Hello everyone, I use a script for scrolling on a graphics tablet, it works fine, but when you pinch the lmb, the cursor shakes, if you remove the MouseMove line, the scrolling becomes too fast, and the cursor starts moving, this should not be, maybe you can help, thank you.

Code: Select all

$*LButton Up::
SetTimer, MBScroll, off
KeyWait, LButton
KeyWait, LButton, D, T0.20

If ErrorLevel = 0
{
	Send {LButton}
}
return

$*LButton::
Sensitivity = 20
MouseGetPos, X1, Y1
SetTimer, MBScroll, 1

MBScroll:
MouseGetPos, X2, Y2
If Abs(Y2-Y1) >= Sensitivity
{
	SendInput, % "{Blind}{Wheel" (Y2 > Y1 ? "Down}" : "Up}")
        MouseMove, 0, % Y1 - Y2, 0, R
}
return

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

Re: AHK: scroling lmb

Post by mikeyww » 23 Jan 2022, 10:28

I'm just guessing, but I don't think that these native AHK commands have inherent ability to identify a pad pinch very reliably. You might want to search the forum for "touchpad pinch" or some other scripts for touchpads, because this sort of action may require special handling.

Wladiskowacz
Posts: 3
Joined: 23 Jan 2022, 09:48

Re: AHK: scroling lmb

Post by Wladiskowacz » 23 Jan 2022, 10:50

Unfortunately, when using the mouse, the same problem. The script is fully working, there is just a slight shaking of the cursor and I thought maybe it could be removed somehow

Wladiskowacz
Posts: 3
Joined: 23 Jan 2022, 09:48

Re: AHK: scroling lmb

Post by Wladiskowacz » 23 Jan 2022, 10:57

mikeyww wrote:
23 Jan 2022, 10:28
I'm just guessing, but I don't think that these native AHK commands have inherent ability to identify a pad pinch very reliably. You might want to search the forum for "touchpad pinch" or some other scripts for touchpads, because this sort of action may require special handling.
Unfortunately, when using the mouse, the same problem. The script is fully working, there is just a slight shaking of the cursor and I thought maybe it could be removed somehow.
I don't think it's related to the tablet, most likely it's because I'm a beginner and I don't know how to write code yet :)

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

Re: AHK: scroling lmb

Post by mikeyww » 23 Jan 2022, 11:13

You could try replacing the mouse move with a short sleep if you simply need a brief delay.

The KeyWait command has two parameters rather than three.
Options: A string of one or more of the following letters (in any order, with optional spaces in between)

Post Reply

Return to “Ask for Help (v1)”