示例#1
0
 def drag(self, title, text, x1, y1, x2, y2):
     '''
     :description 执行鼠标拖拽操作
     '''
     pos = autoit.win_get_pos(title, text=text)
     autoit.mouse_click_drag(x1 + pos[0], y1 + pos[1], x2 + pos[0],
                             y2 + pos[1])
 def drag(cls, lis):
     """
     :description 执行鼠标点击并拖动操作
     :return:
     """
     # pos = autoit.win_get_pos(title, text=text)
     # autoit.mouse_click_drag(x1 + pos[0], y1 + pos[1], x2 + pos[0], y2 + pos[1])
     # 使用绝对位置的情况
     autoit.mouse_click_drag(lis[0], lis[1], lis[2], lis[3])
示例#3
0
def main():
    file_name = "history.txt"
    openfile("pynput_record", file_name)
    l1, t1 = load_replay()
    file_name = "history1.txt"
    openfile("pynput_record", file_name)
    l2, t2 = load_replay()
    file_name = "history2.txt"
    openfile("pynput_record", file_name)
    l3, t3 = load_replay()
    # print("Ready, press '.' to start")
    # keyboard.wait(".")
    play(l1, 1, t1, True)
    play(l2, 1, t2, True)
    play(l3, 1, t3, True)
    autoit.mouse_wheel("down", 30)
    autoit.mouse_click_drag(950, 470, 950, 475, button="right", speed=100)
    autoit.mouse_click_drag(950, 475, 965, 475, button="right", speed=50)
示例#4
0
def view_management():  # 视图管理
    autoit.mouse_click("LEFT", 85, 40, 1, 10)  # 进入视图管理模块
    sleep(1)

    autoit.mouse_click("LEFT", 460, 92, 1, 10)  # 拉狂放大
    autoit.mouse_click_drag(650, 170, 850, 400, "LEFT", 20)
    sleep(1)

    autoit.mouse_click("LEFT", 520, 92, 1, 10)  # 拉狂缩小
    autoit.mouse_click_drag(650, 170, 850, 400, "LEFT", 20)
    sleep(1)

    autoit.mouse_click("LEFT", 570, 92, 1, 10)  # 点击中心放大,点击1次
    sleep(1)

    autoit.mouse_click("LEFT", 620, 92, 2, 10)  # 点击中心缩小,点击2次
    sleep(1)

    autoit.mouse_click("LEFT", 670, 92, 1, 10)  # 漫游
    autoit.mouse_click_drag(800, 350, 400, 350, "LEFT", 20)
    sleep(1)
    autoit.mouse_click_drag(400, 350, 800, 350, "LEFT", 20)
    sleep(1)

    autoit.mouse_click("LEFT", 750, 92, 1, 10)  # 1:1显示
    sleep(1)

    autoit.mouse_click("LEFT", 710, 92, 1, 10)  # 1:1全图
    sleep(1)

    autoit.mouse_click("LEFT", 800, 92, 1, 10)  # 卷帘
    autoit.mouse_click_drag(400, 350, 1000, 350, "LEFT", 20)
    sleep(1)
    autoit.mouse_click_drag(1000, 350, 400, 350, "LEFT", 20)
    sleep(1)

    autoit.mouse_click("LEFT", 850, 70, 1, 10)  # 图层管理打开关闭
    sleep(1)
    autoit.mouse_click("LEFT", 850, 70, 1, 10)
    sleep(1)

    autoit.mouse_click("LEFT", 850, 110, 1, 10)  # 鹰眼打开关闭
    sleep(1)
    autoit.mouse_click("LEFT", 850, 110, 1, 10)
    sleep(1)
示例#5
0
def display_control():  # 显示控制模块
    autoit.mouse_click("LEFT", 160, 40, 1, 10)  # 进入显示控制模块
    sleep(1)
    '''亮度增强'''
    autoit.mouse_click_drag(119, 92, 150, 92, "LEFT", 1)  # 亮度增强,向右拖拽
    sleep(1)
    autoit.mouse_click_drag(150, 92, 80, 92, "LEFT", 1)  # 亮度增强,向左拖拽
    sleep(1)
    autoit.mouse_click("LEFT", 60, 92, 1, 10)  # 亮度增强,点击“-”1次
    sleep(1)
    autoit.mouse_click("LEFT", 175, 92, 2, 10)  # 亮度增强,点击“+”2次
    sleep(1)
    autoit.mouse_click("LEFT", 30, 92, 1, 10)  # 亮度增强,点击“亮度”恢复原状
    '''对比度增强'''
    autoit.mouse_click_drag(305, 92, 340, 92, "LEFT", 1)  # 对比度增强,向右拖拽
    sleep(1)
    autoit.mouse_click_drag(340, 92, 270, 92, "LEFT", 1)  # 对比度增强,向左拖拽
    sleep(1)
    autoit.mouse_click("LEFT", 245, 92, 1, 10)  # 对比度增强,点击“-”1次
    sleep(1)
    autoit.mouse_click("LEFT", 360, 92, 2, 10)  # 对比度增强,点击“+”2次
    sleep(1)
    autoit.mouse_click("LEFT", 220, 92, 1, 10)  # 对比度增强,点击“对比度”恢复原状
    '''透明度增强'''
    autoit.mouse_click_drag(450, 92, 510, 92, "LEFT", 1)  # 透明度增强,向右拖拽
    sleep(1)
    autoit.mouse_click_drag(510, 92, 480, 92, "LEFT", 1)  # 透明度增强,向左拖拽
    sleep(1)
    autoit.mouse_click("LEFT", 435, 92, 1, 10)  # 透明度增强,点击“-”1次
    sleep(1)
    autoit.mouse_click("LEFT", 555, 92, 2, 10)  # 透明度增强,点击“+”2次
    sleep(1)
    autoit.mouse_click("LEFT", 405, 92, 1, 10)  # 透明度增强,点击“透明度”恢复原状
    '''拉伸方式'''

    autoit.mouse_click("LEFT", 745, 92, 1, 10)  # 点击拉伸方式,展开下拉列表
    sleep(1)
    autoit.send("{up 5}")  # 切换到下拉列表第一位
    autoit.send("{enter}")  # 确定选择
    sleep(1)  # 1%线性拉伸

    autoit.mouse_click("LEFT", 745, 92, 1, 10)  # 点击拉伸方式,展开下拉列表
    sleep(1)
    autoit.send("{up 5}")  # 切换到下拉列表第一位
    sleep(1)
    autoit.send("{down 1}")  # 选择下拉列表第二位
    sleep(1)
    autoit.send("{enter}")  # 确定选择
    sleep(1)  # 2%线性拉伸
    '''视图联动与拉伸方式类似'''
示例#6
0
	def drag(self, title, text, x1, y1,x2, y2):
		"""鼠标拖拽"""
		pos = autoit.win_get_pos(title, text=text)
		autoit.mouse_click_drag(x1, y1, x2, y2)
示例#7
0
 def drag(self,x1, y1, x2, y2, button="left", speed=-1):
     '''
     :description 执行鼠标拖拽操作
     '''
     autoit.mouse_click_drag(x1, y1, x2, y2, button, speed)