Handling Cursor on Top of Found Image

Hi,

I am using "Click at Found Image" and it works well but in an off chance, if the cursor happens to be on top of the found image already, it fails.

I can of course move the cursor off screen before searching for the found image, but was wondering if that is the best practice in this case.

That won't be the issue unless the cursor position changes the image being searched for itself. Post your macro and an example of the kind of image you're dealing with. :+1:t3:

Hey Amit,

Welcome to the forum!  :sunglasses:

Yes. The screen is just the screen as far as Keyboard Maestro knows, and the cursor is part of that image.

-Chris

Is that true? In my experience, the mouse pointer doesn't interfere with found images or appear in screenshots. I just tested now by searching for a small found image while visibly obscured by the pointer, and it was found without issue. I also took a screenshot and the pointer was invisible.

1 Like

Thank you. That is what I was noticing.

This is interesting because I would expect your mental model, but I was noticing Chris' mental model.

Also, I am sure if what Chris and I were experiencing was indeed the case, @peternlewis will change the keyboard maestro behavior. I think I am doing something wrong.

As far as I know, Peter can't change what macOS screen recording can "see".

Have you tried the experiments I carried out? Take a screenshot. Can you see the cursor?

Just because your image search isn't working, it doesn't mean it's because the cursor is interfering; based on what I've seen, I'd say it likely isn't.

Post your macro and an example of the kind of image you're searching for. There may be another point of failure.

1 Like

After some reflection (and testing) I think @noisneil is right and I am mistaken.

Aside from testing the KM action I realized the macOS screenshot mechanism can exclude the cursor...

@peternlewis?

The screen capture does not include the mouse pointer, and there is no API option to control this.

3 Likes

And if you do want the pointer included you can shell out and use screencapture with the -C flag, passing variables if you want a window ID or a fixed rectangle.

As @noisneil pointed out, it is probably not the pointer but the image changing because of the pointer being on it -- like web page image buttons that change colour when you hover over them. Depending on how they behave you can put the pointer to a known "safe" place first, you can capture and test all known button states, or do something else more specific to the problem.

3 Likes