← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #697768]: oberserveInBackground question

 

Question #697768 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/697768

    Status: Open => Answered

RaiMan proposed the following answer:
Without any coordination between onAppear handler (your def axn) and the
main workflow (observeInBackground in fact runs in a thread and hence
the handler also), the reactive actions have all to be done in the
handler. Depending on the kind of the actions, they might interfere with
the main workflow (mouse and/or keyboard actions).

So in your case, you should start with the implementation of the handler
and see wether it does what it should.

If you get interference problems with the main workflow, then you have
to do some synchronising.

Easiest: use some global variables, that are set/unset and checked at
places of interest. Depending on the state, something waits for a state
change to proceed. Be careful about possible deadlocks.

At low level the current implementation guarantees, that one mouse
action (click = move, down, up) is completed, before another one can
start (relevant in your case). This is usually sufficient to click away
a popup in a background handler.

For more options, you have to come back after having made some
experiences ;-)

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.