Print the current mouse cursors location

Asked by arminius on 2017-06-14

I have designed my program to deliver my mouse cursor to a spectic point in a screen shot, but I need to drag and drop between that position and the center of the screen.
I can't do that without knowing where the point in the screen shot is, so how do I print where the location of the mouse cursor is?

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
arminius
Solved:
2017-06-21
Last query:
2017-06-21
Last reply:
2017-06-16
masuo (masuo-ohara) said : #1

see this document.
http://sikulix-2014.readthedocs.io/en/latest/globals.html?highlight=getMouseLocation

To realize what you want to do is not only one way.
Document tell us a lot of things.
To know existence of document is important anytime.

arminius (arminius75) said : #2

I look through those documents, they have almost know examples of the code as it should be run.
I don't run right to the forums, I do give it a go, I tried "getMouseLocation()"
it returned "[error] NameError ( name 'getMouseLocation' is not defined )"
If you have the ear of whoever writes these documents ask them if they could please add more examples, the only other programming I'm familier with is autohotkey and conky, their documents always had code you could use, even if it wasn't quite right you could tweak it.

arminius (arminius75) said : #3

"they have almost no examples of the code as it should be run."
Not sure how to edit posts for bad spelling.

arminius (arminius75) said : #4

ok, I see I was leaving the Env off in "Env.getMouseLocation()"
Doesn't seem to be displaying any useful information as to the mouse's location though.

masuo (masuo-ohara) said : #5

I can print mouse location.

mouseMove("1497575948392.png")
ml = Env.getMouseLocation()
print ml
print ml.getX()
print ml.getY()

arminius (arminius75) said : #6

that solved my problem