← Back to team overview

sikuli-driver team mailing list archive

[Question #215070]: Running Sikuli script in background and watching for hotkeys

 

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

Hi Thanks for the help earlier. My questions is listed as answered and I have the script running but there is one hiccup. I was wondering if someone can help with that please: 

 Only way to send hotkeyevents is that the active window is the sikuli screen. Anyway to tell the script to wait for inputs from D3? So that when I press NUM4 in D3 it runs the script listed for hotkey Num 4.  Once again thanks for the prompt help earlier really appreciate it. My script is below. Thanks. 


def Rattack(event):
    myApp.focus()
    wait(1)
    mouseDown(Button.RIGHT)
    wait(3)
    mouseUp(Button.RIGHT)
    
def Lattack(event):
    myApp.focus()
    keyDown(Key.SHIFT)
    wait(0.5)
    mouseDown(Button.LEFT)
    wait(2)
    mouseUp(Button.LEFT)
    keyUp(Key.SHIFT)

Env.addHotkey(Key.NUM4,0, Rattack)
Env.addHotkey(Key.NUM5,0, Lattack)
 
myApp = App("Diablo III")
myApp.focus()
playground = App.focusedWindow()
while 1:
    wait(0.01)

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