[multi-monitor] moveMouse wont move to negative position on mac #88

Open
bradparks opened this Issue Sep 17, 2015 · 10 comments

Comments

Projects
None yet
8 participants
@bradparks

Hey... I use getMousePos to get the mouse position, and it returns negative values sometimes (multiple monitors above my laptop monitor).

I then try and use robot.moveMouse(800, -954) for example, and it only moves to 800, 0.

@Deltatiger

This comment has been minimized.

Show comment
Hide comment
@Deltatiger

Deltatiger Sep 18, 2015

Collaborator

@bradparks The negative mouse coordinates happen in a multi monitor setup. Basically anything left of your primary display may have negative coordinates.
As for the failing moveMouse did you try anything less than -954 ? If you had got (500 , -300) then you can go negative only on the y axis. Also you can only go till the screen max.

If you could provide more details on what you got from moveMousePos , what your arguments for moveMouse and the screen sizes , you can get a better answer.

Collaborator

Deltatiger commented Sep 18, 2015

@bradparks The negative mouse coordinates happen in a multi monitor setup. Basically anything left of your primary display may have negative coordinates.
As for the failing moveMouse did you try anything less than -954 ? If you had got (500 , -300) then you can go negative only on the y axis. Also you can only go till the screen max.

If you could provide more details on what you got from moveMousePos , what your arguments for moveMouse and the screen sizes , you can get a better answer.

@octalmage octalmage added the bug label Sep 22, 2015

@octalmage

This comment has been minimized.

Show comment
Hide comment
@octalmage

octalmage Oct 4, 2015

Owner

The issue is that the code doesn't have explicit multi-monitor support, so anything that works is kind of on accident. I don't think this is an issue on Windows, but for Mac I'll need to look into it.

Owner

octalmage commented Oct 4, 2015

The issue is that the code doesn't have explicit multi-monitor support, so anything that works is kind of on accident. I don't think this is an issue on Windows, but for Mac I'll need to look into it.

@octalmage octalmage changed the title from moveMouse wont move to negative position on mac to [multi-monitor] moveMouse wont move to negative position on mac Nov 3, 2015

@Deltatiger

This comment has been minimized.

Show comment
Hide comment
@Deltatiger

Deltatiger Nov 3, 2015

Collaborator

I think this should be made uniform across all platforms. As you said it is still a hack in Windows. Should probably get the monitor sizes before making the mouse move or throw some kind of error. That would be better.

Collaborator

Deltatiger commented Nov 3, 2015

I think this should be made uniform across all platforms. As you said it is still a hack in Windows. Should probably get the monitor sizes before making the mouse move or throw some kind of error. That would be better.

@octalmage

This comment has been minimized.

Show comment
Hide comment
@octalmage

octalmage Nov 4, 2015

Owner

I agree. I guess we'll need to start with adding c functions to get the number of monitors and their sizes.

Owner

octalmage commented Nov 4, 2015

I agree. I guess we'll need to start with adding c functions to get the number of monitors and their sizes.

@harrisrobin

This comment has been minimized.

Show comment
Hide comment
@harrisrobin

harrisrobin Oct 29, 2016

Would be nice to have this!
Wish I could help.

Would be nice to have this!
Wish I could help.

@Chinafreak

This comment has been minimized.

Show comment
Hide comment
@Chinafreak

Chinafreak Oct 11, 2017

any update of this?

any update of this?

@jareddgotte

This comment has been minimized.

Show comment
Hide comment
@jareddgotte

jareddgotte Dec 24, 2017

I messed around with the code enough to get getPixelColor() working on Windows 10 with 2 monitors. However, in the process of doing so, I've discovered that getting multi-monitor support for every feature would be a massive undertaking. Just about everything in the src folder makes the assumption that the user only needs to operate within their primary display. In @octalmage's defense, though, it appears these files were forked from autopy—most of which haven't been updated in ~8 years.

jareddgotte commented Dec 24, 2017

I messed around with the code enough to get getPixelColor() working on Windows 10 with 2 monitors. However, in the process of doing so, I've discovered that getting multi-monitor support for every feature would be a massive undertaking. Just about everything in the src folder makes the assumption that the user only needs to operate within their primary display. In @octalmage's defense, though, it appears these files were forked from autopy—most of which haven't been updated in ~8 years.

@marcofugaro

This comment has been minimized.

Show comment
Hide comment
@marcofugaro

marcofugaro Jan 29, 2018

This is the only really big issue I'm having with this library, really wish it was implemented

This is the only really big issue I'm having with this library, really wish it was implemented

@friksa

This comment has been minimized.

Show comment
Hide comment

friksa commented Apr 11, 2018

+1

@romanrandom romanrandom referenced this issue in Toinane/colorpicker Apr 11, 2018

Closed

Does not support multiple monitors #26

@marcofugaro

This comment has been minimized.

Show comment
Hide comment
@marcofugaro

marcofugaro Apr 12, 2018

At the end I worked around this issue like this, after having done brew install cliclick (link)

const { exec } = require('child_process')
exec('cliclick c:.')

At the end I worked around this issue like this, after having done brew install cliclick (link)

const { exec } = require('child_process')
exec('cliclick c:.')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment