← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #630986]: Query if a key or key-combo is pressed

 

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

    Status: Open => Answered

masuo proposed the following answer:
You can use like this.

loopctl = True

def handler(event):
    global loopctl
    loopctl = False

Env.addHotkey(Key.END, KeyModifier.CTRL, handler)

while True:
    if loopctl == True:
        print "wait"
        sleep(1)
    else:
        break

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.