← Back to team overview

sikuli-driver team mailing list archive

[Question #631196]: getting y and y of key down arrow

 

New question #631196 on Sikuli:
https://answers.launchpad.net/sikuli/+question/631196

On the windows I have program that have the list
that list have number and the name
here is link to image to see it http://pasteboard.co/2jIf9f2Xw.png

here is code:
click(Pattern("image").targetOffset(0,17))#click on list
    type(Key.DOWN)#click down arrow on list to come to subjects
    type(Key.DOWN)
    type(Key.DOWN)
    #now Im on the first item in list and it is highlighted
    
 What I want is when it comes to highlighted item that have number greater then 1.5 I want to stop 
what I do now is giving some number like 90 and it takes first 90 items, but sometimes there are no
items more like 15 items, so this more like temporary solution.
and here onder is code how it is.

  keyDown(Key.SHIFT)#in the windows to select them all press SHIFT and go with arrow down to select them all
    for i in range(howMuchOfiemsToTake):#usually there are 90 items TODO: do only ones till 1.5
        type(Key.DOWN)#key down to select them all
    sleep(3)
    keyUp(Key.SHIFT)

What I tried is to get from type(key.Down) position of highliting, but there is no object like that and here is the code:
        nidus_point = type(Key.DOWN)#key down to select them all
        myX = nidus_point.getY();
        myZ = nidus_point.getX();
        print myX
        print myY
 if I get y and x of that I could go from that point as offset to check if there is 1.5 as image.

so any ideas would be nice,
thank you
Daka

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