Exemplo n.º 1
0
def on_click(x,y, button, pressed):
    if pressed:
        if len(allActions) != 0 and allActions[-1].actionType == "keyPress" and allActions[-1].getKey() == keyboard.Key.esc:
            return False
        if str(button) == "Button.middle":
            return False
        else:
            newClick = Action("click")
            newClick.setPosition(x, y)
            newClick.setButton(str(button))
            
            allActions.append(newClick)
Exemplo n.º 2
0
def on_scroll(x,y,dx,dy):
    newScroll = Action("scroll")
    newScroll.setPosition(x, y)
    newScroll.setSpeed(dx, dy)

    allActions.append(newScroll)