That's exactly what I was looking for, thanks!
But how would you change the ManualCursorButtonTask function?
Code:
def ManualCursorButtonTask():
"""Use spacebar to manually simulate mouse press/release on canvas"""
while True:
yield viztask.waitKeyDown(' ', priority=viz.PRIORITY_GUI_HANDLER-1)
canvas.sendMouseButtonEvent(viz.MOUSEBUTTON_LEFT, viz.DOWN)
yield viztask.waitKeyUp(' ', priority=viz.PRIORITY_GUI_HANDLER-1)
canvas.sendMouseButtonEvent(viz.MOUSEBUTTON_LEFT, viz.UP)