def __init__(self): tracker.register("gaze", self.on_gaze) self.xy_hist = [Point2d(0, 0)] self.origin = Point2d(0, 0) canvas.register("overlay", self.draw) self.enabled = True
def toggle_watcher(): if mouse.enabled: # print(" unregister") tracker.unregister('gaze', mouse.on_gaze) canvas.unregister('overlay', mouse.draw) # lens mode is useless without eye tracking # noise_model.lens_mode = False else: # print(" register") tracker.register('gaze', mouse.on_gaze) # turn circle back on if it was on previously? if mouse.alpha == not_transparent: canvas.register('overlay', mouse.draw) mouse.enabled = not mouse.enabled
def toggle_circle(): mouse.alpha = not_transparent if mouse.alpha == transparent else transparent if mouse.alpha == transparent: canvas.unregister('overlay', mouse.draw) else: canvas.register('overlay', mouse.draw)