← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #268981]: [1.1.0] Mouse interrupt action after mouse was moved externally by user or other process

 

Question #268981 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/268981

    Status: Open => Answered

RaiMan proposed the following answer:
With latest builds of version 1.1.0 you can do the following:

# somwhere before your main workflow starts:

def handler(e):
  wait(3)
  
Mouse.setMouseMovedCallback(handler)

With each mouse action done by SikuliX, it is checked, wether the mouse is still in the place, where it was left with the last moose action before.
If the mouse is found somewhere else, it is supposed, that the mouse was moved by some Sikuli-external process or the user.

Among other options you can define a handler callback), that is called
in this case.

In your case you want to pause any Sikuli activities for 3 seconds,
which is done by the wait(3).

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.