模拟鼠标滚动


import win32api
from win32con import MOUSEEVENTF_WHEEL
 
 
win32api.mouse_event(MOUSEEVENTF_WHEEL, 0, 0, x)
# x为滚动单位,正数表示向上滚动,负数表示向下滚动

滚动一屏


from win32api import GetSystemMetrics
 
 
 
# width = GetSystemMetrics(0)
height = GetSystemMetrics(1)
win32api.mouse_event(MOUSEEVENTF_WHEEL, 0, 0, -height)

posted @ 2024-05-27 20:39  中华强  阅读(24)  评论(0)    收藏  举报