[request] Option to hide mouse cursor while doing find

Bug #529359 reported by Kashyap
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
SikuliX
Fix Released
Wishlist
RaiMan
Nominated for Obsolete by Vladimir Petrov

Bug Description

since Sikuli X: the screenshot used to search has no mouse pointer visible.
----------------------------------------------------------------------------

Find has failed a number of times for me just because the mouse cursor happened to overlap the image in question.
It would be nice if some kind of option made the mouse cursor disappear before doing the find.

Tags: fkt-region
Revision history for this message
RaiMan (raimund-hocke) wrote :

Good idea and suggestion. Fully agree.

But I don't think, that this should be an option. It should be a general behaviour, to make the mouse cursor invisible during a find() operation (implicit or explicit).

tags: added: api find mousecursor
Revision history for this message
RaiMan (raimund-hocke) wrote :

as a circumvention, one could use a hover() before, to get the curser to a point on the screen, where it does nothing and is out of way.

On my Mac a good position is the upper left "apple", which normally is always there.

Unfortunately a pitfall in the moment is, that hover does not except a Match (bug reported), so you cannot use a saved find() or a Subregion(0,0,100,100).inside().find(), to boost performance by saving an extra screenshot.

You could say:

mouseGarage = find(<image of apple top left>)
click()
hover(MouseGarage)
wait()
click()
hover(MouseGarage)
find()
...

hover(Match) is on the list for 0.10.

The alternative using a click() is only usable, if you have something to click on, so nothing happens, but the app you are interested in does not loose focus.

tags: added: hover
Revision history for this message
Gregor Kopka (mailfrom-launchpad-net) wrote :

My solution under windows is to perform a mouseMove(Location(10000,10000)) to move the mouse to the bottom-right corner of the screen before doing the find.

Revision history for this message
Gregor Kopka (mailfrom-launchpad-net) wrote :

I oppose the request to auto-hide the mouse on find() operations since you can add that functionality with a few lines of python in case you need it.

RaiMan (raimund-hocke)
summary: - [feature request] Option to hide mouse cursor while doing find
+ [request] Option to hide mouse cursor while doing find
Revision history for this message
RaiMan (raimund-hocke) wrote :

With Sikuli X it is some lines of code packed in def() that moves the mouse to a safe place and then brings it back if needed.

These are my helpers stored in my generics lib, that I import in every script.

Settings.SaveMouseLocation = Location(0,10) # save place on Mac

def hideMouse():
 mmd = Settings.MoveMouseDelay
 Settings.MoveMouseDelay = 0
 Settings.SaveMouseLocationSaved = Env.getMouseLocation()
 mouseMove(Settings.SaveMouseLocation)
 Settings.MoveMouseDelay = mmd

def unhideMouse():
 mmd = Settings.MoveMouseDelay
 Settings.MoveMouseDelay = 0
 mouseMove(Settings.SaveMouseLocationSaved)
 Settings.MoveMouseDelay = mmd

I use Settings as temp storage to not have to use global and make usage clear.

usage:
hideMouse(); find(something); unhideMouse()

RaiMan (raimund-hocke)
Changed in sikuli:
importance: Undecided → Wishlist
Revision history for this message
Martin Cohen (martin-balazik) wrote :

I have a serious problem with this. I'm testing a main-menu on Windows. I cannot simply move the mouse (as shown in those two snippets, as the menu would disappear). This way, I'm not able to test it at all.

Revision history for this message
RaiMan (raimund-hocke) wrote :

@ Martin
you should not add questions in comments without subscribing (done it for you ;-)

As far as I understand:
When Sikuli X internally makes a screen capture in preparation for a search operation, then it is taken with the mouse cursor hidden. so this should not be a problem in your case.

Revision history for this message
Martin Cohen (martin-balazik) wrote : Re: [Bug 529359] Re: [request] Option to hide mouse cursor while doing find

Then maybe there was some other problem with the matching algorithm, ignore
me then :D

On 2 September 2012 12:13, RaiMan <email address hidden> wrote:

> @ Martin
> you should not add questions in comments without subscribing (done it for
> you ;-)
>
> As far as I understand:
> When Sikuli X internally makes a screen capture in preparation for a
> search operation, then it is taken with the mouse cursor hidden. so this
> should not be a problem in your case.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/529359
>
> Title:
> [request] Option to hide mouse cursor while doing find
>
> Status in Sikuli:
> New
>
> Bug description:
> Find has failed a number of times for me just because the mouse cursor
> happened to overlap the image in question.
> It would be nice if some kind of option made the mouse cursor disappear
> before doing the find.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/sikuli/+bug/529359/+subscriptions
>

--
Martin "Cohen" Balážik

RaiMan (raimund-hocke)
Changed in sikuli:
status: New → In Progress
assignee: nobody → RaiMan (raimund-hocke)
RaiMan (raimund-hocke)
tags: added: fkt-region
removed: api find hover mousecursor
Changed in sikuli:
status: In Progress → Fix Released
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.