Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
coordinates
#1
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
#2
Code:
Copy      Help
POINT p
GetCursorPos &p
out "%i %i" p.x p.y
#3
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.
#4
Download and import this:
[broken url]

Then create and run this macro code:
Code:
Copy      Help
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
#5
thanks works just fine
#6
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.

Code:
Copy      Help
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


Forum Jump:


Users browsing this thread: 1 Guest(s)