← Back to team overview

sikuli-driver team mailing list archive

[Bug 529359] Re: [request] Option to hide mouse cursor while doing find

 

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()

-- 
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
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.