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

    Status: Open => Answered

Eugene S proposed the following answer:
What I would do in your situation is write a small auxiliary function
that will get the number of times the "UP" button should be pressed as a
parameter. Then you can just call that function with a single line.

It might look something like that:


def buttonPress(button,count):
        """Press any provided button for "count" times. 
        """
        for num in range(1, count+1):
                type(button)


Then you can call it like that:
buttonPress(Key.UP, timesToPress)

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

_______________________________________________
Mailing list: https://launchpad.net/~sikuli-driver
Post to     : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp

Reply via email to