예제 #1
0
 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)
예제 #2
0
 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()
예제 #3
0
 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)
예제 #4
0
    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)
예제 #5
0
    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
예제 #6
0
    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
예제 #7
0
    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)
예제 #8
0
    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
예제 #9
0
 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)
예제 #10
0
    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
예제 #11
0
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()
예제 #12
0
 def mouse_toggle_control_mouse():
     """Toggles control mouse"""
     toggle_control(not config.control_mouse)
예제 #13
0
 def mouse_disable_control_mouse():
     """Disables control mouse if enabled"""
     if config.control_mouse:
         toggle_control(False)
예제 #14
0
 def mouse_enable_control_mouse():
     """Enables control mouse if disabled"""
     if not config.control_mouse:
         toggle_control(True)
예제 #15
0
 def gaze_toggle_control():
     """Toggles controlling mouse via gaze"""
     toggle_control(not gaze_config.control_mouse)