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 __init__(self): tap.register(tap.MMOVE, self.on_move) tracker.register('gaze', self.on_gaze) self.saved_mouse = None self.main_mouse = False self.main_gaze = False self.restore_counter = 0
def mouse_toggle_eye_mouse_sleep_tracker(): """Turn on an off eye mouse sleep tracker""" global sleep_tracker if not sleep_tracker.enabled: tracker.register("gaze", sleep_tracker.on_gaze) sleep_tracker.enabled = True else: tracker.unregister("gaze", sleep_tracker.on_gaze) sleep_tracker.enabled = False app.notify(subtitle="eye sleep tracker: %s" % sleep_tracker.enabled)
def mouse_toggle_blink_click(): """Turn on an off blink clicking""" global blink if not blink.enabled: tracker.register("gaze", blink.on_gaze) blink.enabled = True else: tracker.unregister("gaze", blink.on_gaze) blink.enabled = False app.notify(subtitle="blink click: %s" % blink.enabled)
def __init__(self): if len(ui.screens()) == 1: return tap.register(tap.MMOVE, self.on_move) tracker.register("gaze", self.on_gaze) self.top = None if len(ui.screens()) >= 2: print("Have top screen") self.top = ui.screens()[1] self.saved_mouse_top = Point2d(self.top.x + self.top.width // 2, self.top.y + self.top.height // 2) self.main_mouse = False self.main_gaze = False self.restore_counter = 0
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 on_key(tap, e): # Only do something on key down if not e.down: return # F3 means click if e == "f3": e.block() click() # option+= means toggle tobii on and off. elif e == "alt-=": e.block() if mouse.enabled: print(" unregister") tracker.unregister('gaze', mouse.on_gaze) else: print(" register") tracker.register('gaze', mouse.on_gaze) mouse.enabled = not mouse.enabled
def __init__(self): if len(ui.screens()) == 1: return tap.register(tap.MMOVE, self.on_move) tap.register(tap.MCLICK, self.on_click) tracker.register("gaze", self.on_gaze) self.left = None self.right = None if len(ui.screens()) >= 2: print("Have left screen") self.left = ui.screens()[1] self.saved_mouse_left = Point2d( self.left.x + self.left.width // 2, self.left.y + self.left.height // 2) if len(ui.screens()) == 3: print("Have right screen") self.right = ui.screens()[2] self.saved_mouse_right = Point2d( self.right.x + self.right.width // 2, self.right.y + self.right.height // 2) self.main_mouse = False self.main_gaze = False self.restore_counter = 0
def start_recording(self): tracker.register('gaze', self.on_gaze)
def __init__(self): self.show = False tracker.register("post:gaze", self.on_gaze) ui.register("win_focus", self.on_focus) ui.register("app_activate", self.on_focus)