Exemple #1
0
def on_hiss(active):
    if not active:
        return
    print("Detected")
    global reading_mode
    if reading_mode:
        actions.key("pageup")
        return
    else:
        actions.mouse_click(1)
Exemple #2
0
    def telector_click(anchor: str, button: int = 0):
        """
        Clicks the given anchor
        """

        global labels_ui

        rect = labels_ui.find_rect(anchor)

        if rect is None:
            # Couldn't find them, quit
            return

        init_mouse_x = actions.mouse_x()
        init_mouse_y = actions.mouse_y()

        actions.mouse_move(
            rect.x + rect.width / 2,
            rect.y + rect.height / 2,
        )
        actions.mouse_click(button)
        time.sleep(0.1)

        actions.mouse_move(init_mouse_x, init_mouse_y)
Exemple #3
0
 def corner_click(position: Corner) -> None:
     """Click a position, relative to a corner."""
     actions.self.corner_hover(Corner)
     actions.mouse_click()
Exemple #4
0
 def corner_click(position: Corner) -> None:
     user.corner_hover(position)
     # Need to add a slight pause or we can get misclicks
     time.sleep(0.05)
     # TODO: Is there a setting for mouse click hold?
     actions.mouse_click(hold=16000)
Exemple #5
0
 def double_click(modifiers: List[str] = []):
     """Double left click at current position."""
     with Modifiers(modifiers):
         for i in range(2):
             actions.mouse_click(button=0)
 def corner_click(position: Corner) -> None:
     user.corner_hover(position)
     # Need to add a slight pause or we can get misclicks
     actions.sleep("50ms")
     actions.mouse_click()
Exemple #7
0
 def middle_click(modifiers: List[str] = []):
     """Middle click at current position."""
     with Modifiers(modifiers):
         actions.mouse_click(button=2)
Exemple #8
0
 def right_click(modifiers: List[str] = []):
     """Right click at current position."""
     with Modifiers(modifiers):
         actions.mouse_click(button=1)
Exemple #9
0
 def left_click(modifiers: List[str] = []):
     """Left click at current position."""
     with Modifiers(modifiers):
         actions.mouse_click(button=0)
Exemple #10
0
 def on_pop():
     actions.mouse_click()
Exemple #11
0
 def mouse_click(clickspec: (int, int)):
     """Clicks a mouse button as many times, as specified in clickspec"""
     btn, times = clickspec
     for _ in range(times):
         actions.mouse_click(button=btn)