Page 1 of 1

About the screen coordinates

Posted: 18 Sep 2018, 17:35
by vvde
Hello, i want to know if there's a way to find multiple screen coordinates. I mean, its easy to find a screen coordite with some programs or scripts but for the scripts that i need to find hundreds screen coordinates, it really takes long time to doing it one by one. I'm looking for a program or script that for example will save the coordinate to notepad or memory everytime i press a key or click.(Sorry for my bad english btw)

Re: About the screen coordinates

Posted: 18 Sep 2018, 17:59
by bordop
This may help get you started:

Code: Select all

^LButton::
MouseGetPos, xx, yy
Return

RButton::
SendInput, (%xx%, %yy%)
Return
Be sure to set the coordmode you desire. I have done stuff like this in the past, makes it quite easy to get a lot of coordinates.

Re: About the screen coordinates

Posted: 18 Sep 2018, 18:11
by vvde
Thank you very much! It helped so much

Re: About the screen coordinates

Posted: 18 Sep 2018, 19:01
by vvde
It works well if desktop is on but if there's a window like notepad and if its not on fullscreen, when taking screencordinate, taking as notepad's borders. Like notepad is in center of screen, when the mouse is left up corner its going -x-y although it should be 0,0
Is there any way to fix it, like take the coordinate always as allscreen or it works like that?

Re: About the screen coordinates

Posted: 19 Sep 2018, 03:01
by scriptors
it depends on what you have to do next

yo must set CoordMode to screen and/or to active window, screen have it's coords and "active" window have it's ;)

for example, play with this:

Code: Select all

!^LButton::
CoordMode Pixel, Screen
CoordMode Mouse, Screen
MouseGetPos , OutputVarX, OutputVarY, OutputVarWin, OutputVarControl ; active window
WinGetTitle , title, ahk_id %OutputVarWin% ; name of active window
WinGetPos , X, Y, Wx, Wy, %title%
PixelGetColor , color, %OutputVarX%, %OutputVarY%, RGB
xx := Abs(X - OutputVarX)
yy := Abs(Y - OutputVarY)
MsgBox Coordinate: %OutputVarX% - %OutputVarY%`nTitolo: %title%`nColore: %color%`nControlClick: %xx% %yy%
CoordMode Pixel, Window
CoordMode Mouse, Window
Return

Re: About the screen coordinates

Posted: 19 Sep 2018, 08:46
by vvde
Thanks for all helps ^^ now its working like how i want