>> pyautogui.scroll(-10) # scroll down 10 "clicks">>> pyaut">
赞
踩
scroll()
可以模拟鼠标滚轮的滚动,hscroll()
和vscroll()
分别执行水平和垂直滚动。clicks
参数用于控制滚动量,该参数在不同操作系统下滚动量量不同。并且可以传递x
和y
参数给scroll()
表示先移动到点(x,y)
,再执行鼠标滚轮滚动。
>>> pyautogui.scroll(10) # scroll up 10 "clicks"
>>> pyautogui.scroll(-10) # scroll down 10 "clicks"
>>> pyautogui.scroll(10, x=100, y=100) # move mouse cursor to 100, 200, then scroll up 10 "clicks"
>>> pyautogui.hscroll(10) # scroll right 10 "clicks"
>>> pyautogui.hscroll(-10) # scroll left 10 "clicks"
>>> pyautogui.vscroll(-10) # scroll down 10 "clicks"
>>> pyautogui.vscroll(10) # scroll up 10 "clicks"
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。