java not able to use mouseMove function.

Asked by Arvind on 2019-05-17

I have got some X and Y axis from sikuli and now I am trying to hover mouse on that location using the same xo-ordinates but it return error "[error] Location: outside any screen (3568, 815) - subsequent actions might not work as expected".

Below is my java code.
Screen s=new Screen();
System.out.println(s.find("C:\\ptest.png").getX()+";;"+ s.find("C:\\ptest.png").getY());
int x = s.find("C:\\ptest.png").getX();
int y = s.find("C:\\ptest.png").getY();
s.mouseMove(x,y);

Output in console.
398;;297
[error] Location: outside any screen (3568, 815) - subsequent actions might not work as expected

Question information

Language:
English Edit question
Status:
Answered
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
2019-05-17
Last reply:
2019-05-18
masuo (masuo-ohara) said : #1

Read document.
https://sikulix-2014.readthedocs.io/en/latest/region.html?highlight=mouseMove#Region.mouseMove

usage:mouseMove(xoff, yoff)
explanation:Move the mouse pointer from it’s current position to the position given by the offset values

usage:mouseMove(PSRML)
explanation:PSMRL – a pattern, a string, a match, a region or a location that evaluates to a click point.

And try this codes.
mouseMove("C:\\ptest.png");

or

int x = s.find("C:\\ptest.png").getX();
int y = s.find("C:\\ptest.png").getY();
s.mouseMove(Location(x,y));

Can you help with this problem?

Provide an answer of your own, or ask Arvind for more information if necessary.

To post a message you must log in.