← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #218319]: Making a mouse emulator in Sikuli

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
--- tested on my Mac
seems that the function keys do not work the function keys 

using e.g. 
Env.addHotkey("x",  KeyModifier.CTRL+KeyModifier.ALT, Lclick)

worked for me.

--- errors in your script

def Rclick(event):
    rightClick(Env.getMouseLocation())
    # needs a parameter

def Lclick(event):
    click(Env.getMouseLocation())
    # needs a parameter

def LDown(event):
    global LD
    # to use LD outside of def()
    if LD == 0:
        mouseDown(Button.LEFT)
        LD = 1
    else:
        mouseUp(Button.LEFT)
        LD = 0

LD = 0
Env.addHotkey(Key.F2,0, Lclick)
Env.addHotkey(Key.F3,0, Rclick)
Env.addHotkey(Key.F4,0, LDown)

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.