Xetera / ghost-cursor

🖱️ Generate human-like mouse movements with puppeteer or on any 2D plane
MIT License
1.03k stars 120 forks source link

Getting previous location #94

Closed FanaticFalcon closed 4 months ago

FanaticFalcon commented 1 year ago

Is it possible to get the previous cursor location? or the current? I see that previous var is implemented but seems unachievable.

Xetera commented 1 year ago

previous in the codebase is not where the mouse moved from originally, it's the previous coordinate in the curve, likely a handful of pixels away from where the mouse is currently.

You should just keep track of the movements in your own code as you call move or click instead.

FanaticFalcon commented 1 year ago

Yes, I understand that the previous is the previous [x,y]. So what actually happened is that I get this glitch sometimes where I'm giving coordinates to moveTo and the mouse goes to a different location, close to my [x,y], but different. I was hoping to code a workaround using the current mouse location but I wasn't able to find a way to get that information from node js. This happens randomly so I don't know how to reproduce it in order to report it...

bvandercar-vt commented 4 months ago

PR: https://github.com/Xetera/ghost-cursor/pull/134

Niek commented 4 months ago

Fixed in #134