getting y and y of key down arrow

Asked by daka on 2017-05-04

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

Question information

Language:
English Edit question
Status:
Answered
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
2017-05-04
Last reply:
2017-05-05
RaiMan (raimund-hocke) said : #1

principally not possible with SikuliX:
Only the mouse pointer location is accessible.

Any aspects of a GUI like being selected/highlighted or the position of the input cursor cannot be accessed by SikuliX.
This has to be done visually, by either searching for specific images or by calculating offsets based on the known geometry of the GUI.

... which would be very complex in your situation, that have lines with a high similarity.

If the GUI allows to use copy (ctrl-c) to get GUI-content to the clipboard, then you might have a chance to analyse the information and make your decisions, how to proceed.

Can you help with this problem?

Provide an answer of your own, or ask daka for more information if necessary.

To post a message you must log in.