本文整理匯總了Python中pyautogui.scroll方法的典型用法代碼示例。如果您正苦於以下問題:Python pyautogui.scroll方法的具體用法?Python pyautogui.scroll怎麽用?Python pyautogui.scroll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pyautogui
的用法示例。
在下文中一共展示了pyautogui.scroll方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: scroll_down
# 需要導入模塊: import pyautogui [as 別名]
# 或者: from pyautogui import scroll [as 別名]
def scroll_down(dy: int = None, iterations: int = 1):
"""Scroll down mouse event."""
Mouse().scroll(0, -abs(dy), iterations)
示例2: scroll_up
# 需要導入模塊: import pyautogui [as 別名]
# 或者: from pyautogui import scroll [as 別名]
def scroll_up(dy: int = None, iterations: int = 1):
"""Scroll up mouse event."""
Mouse().scroll(0, abs(dy), iterations)
示例3: scroll_left
# 需要導入模塊: import pyautogui [as 別名]
# 或者: from pyautogui import scroll [as 別名]
def scroll_left(dx: int = None, iterations: int = 1):
"""Scroll left mouse event."""
Mouse().scroll(-abs(dx), 0, iterations)
示例4: scroll_right
# 需要導入模塊: import pyautogui [as 別名]
# 或者: from pyautogui import scroll [as 別名]
def scroll_right(dx: int = None, iterations: int = 1):
"""Scroll right mouse event."""
Mouse().scroll(abs(dx), 0, iterations)
示例5: scroll
# 需要導入模塊: import pyautogui [as 別名]
# 或者: from pyautogui import scroll [as 別名]
def scroll(clicks):
"""Performs a scroll of the mouse scroll wheel.
:param clicks: The amount of scrolling to perform.
:return: None.
"""
pyautogui.scroll(clicks)
示例6: test_scroll
# 需要導入模塊: import pyautogui [as 別名]
# 或者: from pyautogui import scroll [as 別名]
def test_scroll(self):
# TODO - currently this just checks that scrolling doesn't result in an error.
pyautogui.scroll(1)
pyautogui.scroll(-1)
pyautogui.hscroll(1)
pyautogui.hscroll(-1)
pyautogui.vscroll(1)
pyautogui.vscroll(-1)
示例7: scroll_to
# 需要導入模塊: import pyautogui [as 別名]
# 或者: from pyautogui import scroll [as 別名]
def scroll_to(value, x=None, y=None, interval=None):
if interval is not None:
time.sleep(interval)
pyautogui.scroll(value, x, y)
# Create directory(s) if not exist