def mouse_toggle_control_mouse(): """Toggles control mouse""" if not config.control_mouse: app.notify(subtitle="Control mouse: ON") else: app.notify(subtitle="Control mouse: OFF") toggle_control(not config.control_mouse)
def mouse_sleep(): """Disables control mouse, zoom mouse, and re-enables cursor""" eye_zoom_mouse.toggle_zoom_mouse(False) toggle_control(False) show_cursor_helper(True) stop_scroll() if 1 in ctrl.mouse_buttons_down(): actions.user.mouse_drag()
def switch_mouse(): """Switches between the two mouse modes""" if not config.control_mouse: eye_zoom_mouse.toggle_zoom_mouse(False) toggle_control(True) else: toggle_control(False) eye_zoom_mouse.toggle_zoom_mouse(True)
def move_mouse_to_current_gaze_position(): """Moves the mouse to where you are currently looking at""" global eye_tracker_sleep_timer_delay #schedule_putting_eye_tracker_to_sleep(eye_tracker_sleep_timer_delay) toggle_control(True) actions.sleep("100ms") toggle_control(False)
def doIt(): global mouse_control_active global put_eye_tracker_to_sleep_timer mouse_control_active = False eye_zoom_mouse.toggle_zoom_mouse(False) toggle_control(False) if (put_eye_tracker_to_sleep_timer): put_eye_tracker_to_sleep_timer.clearTimeout() put_eye_tracker_to_sleep_timer = None
def stop_mouse_control(): """Stops mouse control""" global mouse_control_active global eye_tracker_sleep_timer_delay #schedule_putting_eye_tracker_to_sleep(eye_tracker_sleep_timer_delay) if (mouse_control_active): toggle_control(False) mouse_control_active = False
def mouse_sleep(): """Disables control mouse, zoom mouse, and re-enables cursor""" eye_zoom_mouse.toggle_zoom_mouse(False) toggle_control(False) show_cursor_helper(True) stop_scroll() # todo: fixme temporary fix for drag command button_down = len(list(ctrl.mouse_buttons_down())) > 0 if button_down: ctrl.mouse_click(button=0, up=True)
def start_mouse_control(): """Starts mouse control""" global mouse_control_active global eye_tracker_sleep_timer_delay #schedule_putting_eye_tracker_to_sleep(eye_tracker_sleep_timer_delay) eye_zoom_mouse.toggle_zoom_mouse(True) # This will keep Tobii running if (not mouse_control_active): toggle_control(not config.control_mouse) mouse_control_active = True
def toggle_recent_mouse(): """Toggles the most recent mouse mode""" global last_active # if not using zoom mouse, see if we meet the criteria for using control mouse if (config.control_mouse or last_active == "control") and not eye_zoom_mouse.zoom_mouse.enabled: print("toggling control mouse") last_active = "control" # remember that we used control mouse recently toggle_control(not config.control_mouse) # default to using zoom mouse else: print("toggling zoom mouse") last_active = "zoom" # remember that we used zoom mouse recently eye_zoom_mouse.toggle_zoom_mouse(not eye_zoom_mouse.zoom_mouse.enabled)
def mouse_gaze_scroll(): """Starts gaze scroll""" global continuous_scoll_mode continuous_scoll_mode = "gaze scroll" start_cursor_scrolling() if setting_mouse_hide_mouse_gui.get() == 0: gui_wheel.show() # enable 'control mouse' if eye tracker is present and not enabled already global control_mouse_forced if eye_mouse.tracker is not None and not config.control_mouse: toggle_control(True) control_mouse_forced = True
def stop_scroll(): global scroll_amount, scroll_job, gaze_job scroll_amount = 0 if scroll_job: cron.cancel(scroll_job) if gaze_job: cron.cancel(gaze_job) global control_mouse_forced if control_mouse_forced and config.control_mouse: toggle_control(False) control_mouse_forced = False scroll_job = None gaze_job = None gui_wheel.hide()
def mouse_toggle_control_mouse(): """Toggles control mouse""" toggle_control(not config.control_mouse)
def mouse_disable_control_mouse(): """Disables control mouse if enabled""" if config.control_mouse: toggle_control(False)
def mouse_enable_control_mouse(): """Enables control mouse if disabled""" if not config.control_mouse: toggle_control(True)
def gaze_toggle_control(): """Toggles controlling mouse via gaze""" toggle_control(not gaze_config.control_mouse)