← Back to team overview

sikuli-driver team mailing list archive

[Question #186261]: Randomising navigation keyboard inputs

 

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

Hi All,
I am very new to sikuli and python and currently testing an action script app using flash player.
I am trying to create some sort of array that contains the navigation inputs UP, DOWN, LEFT, RIGHT etc. then select one at random.
Here is what i have but it only seems to execute all the inputs i put in the list at once.

    import random
    up = type(Key.UP)
    down = type(Key.DOWN)
    leftt = type(Key.LEFT)
    rightt = type(Key.RIGHT)
    move = (
            up,
            down,
            leftt,
            rightt,
            )
    nav = random.choice(move)
    print(nav)
    nav

here is the log

[log] TYPE ""

[log] TYPE ""
[log] TYPE ""

[log] TYPE ""
1

Please advise on my code or on what methods i should be using to get a random selection from a defined list work.
Many Thanks
Tim


-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.