Exemplo n.º 1
0
    def tuo(self, src_x, src_y, tar_x, tar_y):
        m = Mouse(self.metrics_x, self.metrics_y)
        dx = tar_x - src_x
        dy = tar_y - src_y
        x = src_x
        y = src_y
        m.mouse_to(x, y)  # 鼠标移动到
        m.left_down()
        i = 1
        # ddy = int(dy / 10)

        # while i < 10:
        #     time.sleep(0.03)
        #     m.mouse_to(x, y + ddy * i)  # 鼠标移动到
        #     i += 1
        #
        # i = 1
        ddx = int(dx / 6)

        while i < 6:
            time.sleep(0.05)
            m.mouse_to(x + ddx * i, tar_y)  # 鼠标移动到
            i += 1

        time.sleep(0.1)
        m.mouse_to(tar_x + 3, tar_y)  # 鼠标移动到
        time.sleep(0.3)
        m.left_up()

        # time.sleep(1)
        # Window.temp_jie_tu(self.handle)# 更新截图
        return
Exemplo n.º 2
0
    def tuo(self, src_x, src_y, tar_x, tar_y):
        m = Mouse(self.metrics_x, self.metrics_y)
        dx = tar_x - src_x
        dy = tar_y - src_y
        x = src_x
        y = src_y
        m.mouse_to(x, y)  # 鼠标移动到
        m.left_down()
        i = 1
        ddy = int(dy / 10)
        ddx = int(dx / 10)

        while i < 10:
            time.sleep(0.03)
            m.mouse_to(x + ddx * i, y + ddy * i)  # 鼠标移动到
            i += 1

        time.sleep(0.02)
        m.mouse_to(tar_x, tar_y)  # 鼠标移动到
        time.sleep(0.1)
        m.left_up()

        time.sleep(1)
        return