BlueM / cliclick

macOS CLI tool for emulating mouse and keyboard events
https://www.bluem.net
Other
1.59k stars 116 forks source link

How to define the X,Y position? #146

Open leoheck opened 2 years ago

leoheck commented 2 years ago

I could not find in the Readme anything about the X,Y position so I don't know how this is going to work across multiple screen sizes and resolutions. Does it remain the same?

After some time I figured that I could use the mouse move m: to place the mouse at a specific location to have an easy way to get those x,y pairs. Do you have a better way to know the x,y value of a specific point on the screen?

How does this work? Is this related to the resolution of the screen?

How do you determine the x,y you want to click?

BlueM commented 2 years ago

There are a number of ways to get the coordinates of a point:

leoheck commented 2 years ago

Thank you, this a good and important info to be on Readme.

Now, how does it work? Is this based on the resolution? What happens with the coordinates when using different screen sizes. Are they going to happen in the same relative location?

BlueM commented 2 years ago

The coordinates will always be relative to the top left corner of the main screen, regardless of the screen size. If you tell cliclick to move to 2500,1800 on a screen which is only 1024 x 768, no error will occur, the cursor will just be moved as far as possible.