← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #177234]: Backspace x 10

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
2 of many solutions ;-)

--1.
def myMulti(n, k = Key.BACKSPACE):
     for i in range n:
         type(k)

# usage:
myMulti(30)) # 30 backspaces
myMulti(10, Key.DOWN) # 10 down's

--2: 
def myMulti(n, k = Key.BACKSPACE):
     r = k
     for i in range n-1:
         k += Key.BACKSPACE)
     return r

# usage
type(myMulti(30)) # 30 backspaces
type(myMulti(10, Key.DOWN)) # 10 down's

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