[1.1.4 Jython] Settings.MoveMouseDelay doesn't work and is influenced by Settings.setShowActions()

Asked by Dirk Schiller on 2019-02-09

*********************** relation between MoveMoseDelay and ShowActions
when ShowActions is switched on (setShowActions(true)), the current setting of MoveMouseDelay is saved and restored when ShowActions is switched off again (setShowActions(false)), so MouseMoveDelay can be set to a different value during the show actions phase:
Settings.MoveMouseDelay = 0 # very fast - no delay
Settings.setShowActions(True)
Settings.MoveMouseDelay = 2 # very slow
...
Settings.setShowActions(False)
# now very fast again
-------------------------------------------------------------------------------------------------

Script:
=====
import os, sys, time
sys.path.append(os.path.dirname(os.path.realpath(__file__)) + '/sikulixapi.jar')

from org.sikuli.script import App
from org.sikuli.script import Screen
from org.sikuli.basics import Settings
from org.sikuli.script import Mouse
from org.sikuli.script import Location

class Sikuli:

    def __init__(self):
        Mouse.setMouseMovedAction(0)
        # Settings.MoveMouseDelay = 5 # Doesn't show any Effect
        # Settings.MoveMouseDelay = 1 # Doesn't show any Effect
        # Settings.MoveMouseDelay = 0 # Doesn't show any Effect
        # Settings.MoveMouseDelay = 0.1 # Doesn't show any Effect
        # Settings.SlowMotionDelay = 10 # Doesn't show any Effect
        # Settings.Highlight = False # Fires two Times per Action
        # Settings.setShowActions(False) # Doesn't show any Effect
        # Mouse.setMouseMovedHighlight(True) # Doesn't show any Effect
        Settings.MinSimilarity = 0.95
        self.screen = Screen()

    def app(self, app):
        try:
            self.app = App(app)
        except:
            pass
        finally:
            self.app = App(app)

    def app_open(self):
        self.app.open()

    def app_close(self):
        self.app.close()

    def move_offset(self, x, y):
        Mouse.move(x, y)

    def move(self, x, y):
        loc = Location(x, y)
        Mouse.move(loc)

    def click_image(self, image, timeout=5):
        self.move(0, 0)
        reg = self.screen.wait(image, timeout)
        reg.highlight(1) # reg.highlight() disable the Click Action; Clicks doesn't come trough; Use reg.highlight(<int>) instead
        self.screen.click(image)

Versions:
=======
Jython 2.7.0
SikuliXApi.jar Version 1.1.4
Windows 10

Questiom:
========
It seems the Settings.MoveMouseDelay Attribute / Setting doesn't show any Effect. Any Magic here ?

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
2019-02-09
Last reply:
2019-02-10
Dirk Schiller (dschiller) said : #1

Reasearch:
=========

Example which doesn't work:
--------------------------------------------
# ... Some Code ...
Settings.MoveMouseDelay = 0
Settings.setShowActions(False)

Example which works:
---------------------------------
# ... Some Code ...
Settings.MoveMouseDelay = 0

Dirk Schiller (dschiller) said : #3

I figured out that it works if I don't use Settings.setShowActions(False) afterwards or if I use Settings.setShowActions(True). Means the Settings.setShowActions(False) has influence to the Settings.MoveMouseDelay Attribute.

RaiMan (raimund-hocke) said : #4

should be clear now