← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #186261]: Randomising navigation keyboard inputs

 

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

    Status: Answered => Solved

Tim Brayne confirmed that the question is solved:
Many thanks RaiMan!!!
I got your top example working with...

def randomType(direction):
    if direction == "up":
        type(Key.UP)
    elif direction == "down":
        type(Key.DOWN)
    elif direction == "left": 
        type(Key.LEFT)
    elif direction == "right": 
        type(Key.RIGHT)
    else: print direction, ": invalid direction"

move = ( "up", "down", "left", "right")
nav = random.choice(move)
print "now moving", nav
randomType(nav)

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