gesture_hci.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:CE264-Computer_Vision 作者: RobinCPC 项目源码 文件源码
def test_auto_gui(self):
        if self.cmd_switch:
            # Drag mouse to control some object on screen (such as google map at webpage)
            distance = 100.
            while distance > 0:
                pyautogui.dragRel(distance, 0, duration=2, button='left')    # move right
                distance -= 25
                pyautogui.dragRel(0, distance, duration=2, button='left')    # move down
                distance -= 25
                pyautogui.dragRel(-distance, 0, duration=2, button='left')    # move right
                distance -= 25
                pyautogui.dragRel(0, -distance, duration=2, button='left')    # move down
                distance -= 25

            # scroll mouse wheel (zoom in and zoom out google map)
            pyautogui.scroll(10, pause=1.)
            pyautogui.scroll(-10, pause=1)

            pyautogui.scroll(10, pause=1.)
            pyautogui.scroll(-10, pause=1)

            # message box
            pyautogui.alert(text='pyautogui testing over, click ok to end', title='Alert', button='OK')
            self.cmd_switch = not self.cmd_switch   # turn off

# main function of the project (run all processes)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号