Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mouse click doesn't work on external monitor with negative x and y #71

Closed
morajabi opened this issue May 21, 2021 · 0 comments · Fixed by #119
Closed

Mouse click doesn't work on external monitor with negative x and y #71

morajabi opened this issue May 21, 2021 · 0 comments · Fixed by #119

Comments

@morajabi
Copy link
Contributor

morajabi commented May 21, 2021

Version
2.1.2

Short overview
Mouse move works well on bounds like -20, -200 using an external monitor. But as soon as I do mouseClick, it moves the mouse the primary display. It's like it doesn't support negative bounds.

Detailed error description
image
The real position obtained from Electron, versus the incorrect unsigned position returned by libnut.getMousePos().

Steps to reproduce error
nut.mouseClick(-20, -200)

Solution
You should use

#define MMSignedPointFromCGPoint(p) MMPointMake((int32_t)(p).x, (int32_t)(p).y)

instead of MMPointFromCGPoint

I'm on M1 MacBook 13" Pro.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant