SikuliX1 icon indicating copy to clipboard operation
SikuliX1 copied to clipboard

Highlight should not steal focus or at least restore it

Open LisBerndt opened this issue 5 years ago • 3 comments

Hello!

When patterns are highlighted, the taskbar shows the corresponding java-task (see screenshot). This is somewhat disturbing while, e.g., writing automatically into a console, because the console is no longer focussed.

Is it possible to put the highlighting-task into background completely? effect

LisBerndt avatar Mar 04 '20 12:03 LisBerndt

as a workaround you might use a function like this

def myHighlight(what, time, app):
    what.highlight(time)
    App.focus(app) # find out what works
    wait(0.3) # might be needed and adjusted

RaiMan avatar Mar 05 '20 07:03 RaiMan

I simply tried to switch off highlighting for some situations by setting the highlight duration to 0. But then highlighting is executed infinitely! --> Though duration is zero, in class Highlight the frame is set visible respectively never being closed.

PS: I realized that setting duration to zero would not solve my problem, because an Highlight object is given back although. Maybe it could be arranged, that Region only creates an Highlight object when duration (i.e. "secs") > 0?

LisBerndt avatar Mar 05 '20 09:03 LisBerndt

... that Region only creates an Highlight object when duration (i.e. "secs") > 0?

Will be available in the 2.0.4 the next days.

RaiMan avatar Mar 05 '20 11:03 RaiMan