Posts: 48
Threads: 18
Joined: Sep 2005
Hi,
Is it possible to write a macro that gives mouse coordinates next to the mouse pointer? Of course these should change while a mouse is moving.
Best
Posts: 12,140
Threads: 142
Joined: Dec 2002
POINT p
GetCursorPos &p
out "%i %i" p.x p.y
Posts: 48
Threads: 18
Joined: Sep 2005
Thats not what i ment.
I`d like to have coordinates appear next to the mouse pointer changing dinamicly when i`m moving my mouse.
Like in QM window there are screen/win coordinates changing when mouse is moving. I`d like to have such coordinates displayed just above the mouse pointer.
Posts: 175
Threads: 43
Joined: Jun 2004
Download and import this:
[broken url]
Then create and run this macro code:
str MouCoor
int mx my
rep
,mx=xm
,my=ym
,MouCoor.from("(" mx "," my ")")
,OnScreenDisplay(MouCoor 0.5 mx+10 my "" 8 )
,OnScreenDisplay(MouCoor 0.5 mx+11 my+1 "" 8 0x000001)
,0.4
,
Matt B
Posts: 48
Threads: 18
Joined: Sep 2005
Posts: 175
Threads: 43
Joined: Jun 2004
Glad it works for you, however you should change it to a function if you plan to use it while running other macros. Open the macro, go to file, properties, and on the "None" tab change type to function. Here's a better version. It keeps the coordinates on the screen at the edges and stops the function if you go all the way to the bottom right corner.
str MouCoor
int mx my omx omy sy sx
sy=ScreenHeight
sx=ScreenWidth
rep
,mx=xm
,my=ym
,if(mx+100 > sx)
,,omx=mx-50
,else
,,omx=mx+20
,if(my+30 > sy)
,,omy=my-20
,else
,,omy=my+2
,if((xm=sx-1 && ym=sy-1 ))
,,end
,MouCoor.from("(" mx "," my ")")
,OnScreenDisplay(MouCoor 0.2 (omx) omy "" 7 )
,OnScreenDisplay(MouCoor 0.2 (omx+1) omy+1 "" 7 0x000001)
,0.15
Matt B