Beispiel #1
0
def mouse_wake():
    """Enable control mouse, zoom mouse, and disables cursor"""
    eye_zoom_mouse.toggle_zoom_mouse(True)
    if setting_mouse_control_mouse.get() >= 1:
        eye_mouse.control_mouse.enable()
    if setting_mouse_wake_hides_cursor.get() >= 1:
        show_cursor_helper(False)
Beispiel #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()
Beispiel #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)
Beispiel #4
0
 def mouse_sleep():
     """Disables control mouse, zoom mouse, and re-enables cursor"""
     global dragging
     eye_zoom_mouse.toggle_zoom_mouse(False)
     # eye_mouse.control_mouse.disable()
     show_cursor_helper(True)
     stop_scroll()
     if dragging:
         mouse_drag()
Beispiel #5
0
 def mouse_toggle_zoom_mouse():
     """Toggles zoom mouse setting"""
     eye_zoom_mouse.toggle_zoom_mouse(not eye_zoom_mouse.zoom_mouse.enabled)
     s = "Zoom mouse: "
     if eye_zoom_mouse.zoom_mouse.enabled:
         s += "ENABLED"
     else:
         s += "DISABLED"
     app.notify(subtitle=s)
Beispiel #6
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
Beispiel #7
0
    def stop(self, *_):
        if not shimmer_effect_enabled.get():
            self.mcanvas.unregister("draw", self.draw)
        self.active = False
        if self.was_control_mouse_active and not eye_mouse.control_mouse.enabled:
            eye_mouse.control_mouse.toggle()
        if self.was_zoom_mouse_active and not eye_zoom_mouse.zoom_mouse.enabled:
            eye_zoom_mouse.toggle_zoom_mouse(True)

        self.was_zoom_mouse_active = False
        self.was_control_mouse_active = False
Beispiel #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
Beispiel #9
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)
 def show(self):
     if self.active:
         return
     # noinspection PyUnresolvedReferences
     if eye_zoom_mouse.zoom_mouse.enabled:
         self.was_zoom_mouse_active = True
         eye_zoom_mouse.toggle_zoom_mouse(False)
     if eye_mouse.control_mouse.enabled:
         self.was_control_mouse_active = True
         eye_mouse.control_mouse.toggle()
     self.mcanvas.register("draw", self.draw)
     self.mcanvas.freeze()
     self.active = True
Beispiel #11
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)
Beispiel #12
0
    def close(self):
        if not self.active:
            return
        self.mcanvas.unregister("draw", self.draw)
        self.mcanvas.close()
        self.mcanvas = None
        self.img = None

        self.active = False
        if self.was_control_mouse_active and not eye_mouse.control_mouse.enabled:
            eye_mouse.control_mouse.toggle()
        if self.was_zoom_mouse_active and not eye_zoom_mouse.zoom_mouse.enabled:
            eye_zoom_mouse.toggle_zoom_mouse(True)

        self.was_zoom_mouse_active = False
        self.was_control_mouse_active = False
Beispiel #13
0
 def start(self, *_):
     if self.active:
         print("already active - won't start")
         return
     # noinspection PyUnresolvedReferences
     if eye_zoom_mouse.zoom_mouse.enabled:
         self.was_zoom_mouse_active = True
         eye_zoom_mouse.toggle_zoom_mouse(False)
     if eye_mouse.control_mouse.enabled:
         self.was_control_mouse_active = True
         eye_mouse.control_mouse.toggle()
     if self.mcanvas is not None:
         print("unregistering a canvas")
         self.mcanvas.unregister("draw", self.draw)
     self.mcanvas.register("draw", self.draw)
     print("grid activating")
     self.active = True
     return True
    def close(self):
        if not self.active:
            return
        self.mcanvas.unregister("draw", self.draw)
        self.mcanvas.close()
        self.mcanvas = None
        self.img = None
        self.input_so_far = ""

        # actions.user.mouse_grid_help_overlay_close()

        self.active = False
        if self.was_control_mouse_active and not eye_mouse.control_mouse.enabled:
            eye_mouse.control_mouse.toggle()
        if self.was_zoom_mouse_active and not eye_zoom_mouse.zoom_mouse.enabled:
            eye_zoom_mouse.toggle_zoom_mouse(True)

        self.was_zoom_mouse_active = False
        self.was_control_mouse_active = False
Beispiel #15
0
 def mouse_toggle_zoom_mouse():
     """Toggles zoom mouse"""
     eye_zoom_mouse.toggle_zoom_mouse(not eye_zoom_mouse.zoom_mouse.enabled)
Beispiel #16
0
 def gaze_enable_zoom():
     """Activates controlling mouse via gaze with zoom"""
     eye_zoom_mouse.toggle_zoom_mouse(True)
Beispiel #17
0
 def gaze_disable_zoom():
     """Disables zoom mode for controlling mouse via gaze"""
     eye_zoom_mouse.toggle_zoom_mouse(False)