← Back to team overview

sikuli-driver team mailing list archive

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

 

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

Hi I want to make a Sikuli mouse emulator to control three functions through keyboard hotkeys: 
1) Emulate Right and left click.
2) Emulate LEft click down when hot key is pressed and release Leftclick down when the same hotkey is pressed. This is my script but it does not work. Any advise?

def Rclick(event):
    rightClick()    
def Lclick(event):
    click()
def LDown(event):
    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.