Click() Implementation in Code

Asked by jeff on 2020-02-20


I'm trying to learn to navigate the code.

Where is the implementation of the Click() call inside the codebase?


Question information

English Edit question
Sikuli Edit question
No assignee Edit question
Last query:
Last reply:
Manfred Hampl (m-hampl) said : #1

The repository that you are referring to is outdated.
See the (bottom half of that page):
!!!This Sikuli X-1.0rc3 IS NO LONGER SUPPORTED !!!

Link to the current repository:

Code for click():

RaiMan (raimund-hocke) said : #2

... addition to comment#1:

org.sikuli.Script.Region::click -> org.sikuli.Script.Mouse::click

... and finally the real clicking is done via Java AWT Robot (org.sikuli.Script.DesktopRobot)

be aware: in branch master I am currently doing some massive refactoring (version 2.1.0), so looking into the release branch is safer ;-)

jeff (ffejrekaburb) said : #3

Thank you! I'm starting to get oriented.

I'm interpreting "loc" in this line to mean the coordinates are passed in(?).

 protected static int click(Location loc, int buttons, Integer modifiers, boolean dblClick, Object owner) {

Are the locations recognized via OpenCV? Where is that call?

I'm working to understand the sensitivity of Display geometries on recognition.

RaiMan (raimund-hocke) said : #4

Mouse has nothing to do with recognition.

It simply handles a x/y pixel coordinate and uses Java AWT Robot to do the requested Mouse actions.

Additionally it locks the Mouse for other parallel actions either globally (no region given) or for the given region.

jeff (ffejrekaburb) said : #5

Thanks for the information.

I am using click() inside of sikulixID, where the arguments manifest as click([Image])

I'm thinking the match of that [Image] to screen coordinates is done here?

RaiMan (raimund-hocke) said : #6

finally deep down, yes ;-)

But here you would land also, if you start with something like:

finder = Finder(someImage)
if (finder.hasNext()):

doFindMatch only finds one image in another image (which might be a screenshot).

Can you help with this problem?

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

To post a message you must log in.