← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #669822]: How do I make sikuli search only to the left of current mouse position?

 

Question #669822 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/669822

    Status: Open => Answered

arminius proposed the following answer:
I'm new at this, so make sure your backed up before you try it, but I managed to get a square region to go left of the mouse location, you should be able to swap out the mouse location for near the right of whatever images your looking for.
You can adjust the shape of the region easily by changing the Xis,Yis, Wis,His.

    wait(2)
    ml = Env.getMouseLocation()
    Xis = ml.getX()
    print(Xis)
    new_Xis = Xis - 400
    print(new_Xis)
    Yis = ml.getY()
    print(Yis)
    new_Yis = Yis - 200
    print(new_Yis)
    Wis = 400
    His = 400
    print(new_Xis)
    print(new_Yis)
    print(Wis)
    print(His)
    Left_Region_of_mouse_location = Region(new_Xis,new_Yis,Wis,His)
    Left_Region_of_mouse_location.highlight(5)

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.