Ignore rapid jerky mouse movement

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
bwfm
Posts: 2
Joined: 26 Sep 2022, 05:02

Ignore rapid jerky mouse movement

Post by bwfm » 26 Sep 2022, 05:08

Hi.

I am using a wireless mouse on my Windows 10. Recently my mouse started behaving erraticaly, i.e. sometimes the cursor suddenly "teleports" a few centimeters. I believe it to be a software issue. I was unable to find a solution on the web.

Is there a way to write a script so that my PC would ignore "too fast" mouse movement? Like, if it moves 100 px within 0.05 seconds?

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

Re: Ignore rapid jerky mouse movement

Post by mikeyww » 26 Sep 2022, 06:03

Welcome to this AutoHotkey forum!

I do not have an answer, but a question: what does it mean to ignore a mouse movement that has already occurred?

I think that there is a way to block the mouse but capture the movements. It seems that this could make for a rather unpleasant experience! There may be posts to accomplish it if you wish.

Ideas:

https://www.autohotkey.com/board/topic/50381-mapping-mouse-movements-to-arrow-keys/

viewtopic.php?t=45307&start=20

viewtopic.php?p=55503#p55503

RussF
Posts: 1230
Joined: 05 Aug 2021, 06:36

Re: Ignore rapid jerky mouse movement

Post by RussF » 26 Sep 2022, 06:39

Did you check the batteries?

Russ

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

Re: Ignore rapid jerky mouse movement

Post by mikeyww » 26 Sep 2022, 07:03

Good question. I have a trackball & clean the dust out of it periodically, too.

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

Re: Ignore rapid jerky mouse movement

Post by Rohwedder » 26 Sep 2022, 09:58

Hallo,
try:

Code: Select all

#Persistent
CoordMode, Mouse, Screen
SetTimer, Mouse, 50
MouseGetPos, X1, Y1
Mouse:
MouseGetPos, X2, Y2
IF (10000 < (X2-X1)*(X2-X1)+(Y2-Y1)*(Y2-Y1))
	MouseMove, X1, Y1, 0 ; moves > 100 px within 0.05 seconds
Else
	X1 := X2, Y1 := Y2
Return

Post Reply

Return to “Ask for Help (v1)”