You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
Harry2010410
changed the title
add
建议增加MiddlePressMouse、MiddleReleaseMouse、DoubleMiddleClick方法
Jul 27, 2020
Harry2010410
changed the title
建议增加MiddlePressMouse、MiddleReleaseMouse、DoubleMiddleClick方法
建议增加MiddlePressMouse、MiddleReleaseMouse、MiddleDragDrop、DoubleMiddleClick方法
Jul 27, 2020
Harry2010410
changed the title
建议增加MiddlePressMouse、MiddleReleaseMouse、MiddleDragDrop、DoubleMiddleClick方法
建议增加MiddlePressMouse、MiddleReleaseMouse、MiddleDragDrop方法
Jul 28, 2020
Uh oh!
There was an error while loading. Please reload this page.
建议大佬,审阅增加以下封装方法,多谢啦!
uiautomation line1916 增加鼠标中键按压释放方法MiddlePressMouse、MiddleReleaseMouse
line2010增加拖移中键方法MiddleDragDrop
def MiddlePressMouse(x: int, y: int, waitTime: float = OPERATION_WAIT_TIME) -> None:
"""
Press middle mouse.
x: int.
y: int.
waitTime: float.
"""
SetCursorPos(x, y)
screenWidth, screenHeight = GetScreenSize()
mouse_event(MouseEventFlag.MiddleDown | MouseEventFlag.Absolute, x * 65535 // screenWidth, y * 65535 // screenHeight, 0, 0)
time.sleep(waitTime)
def MiddleReleaseMouse(waitTime: float = OPERATION_WAIT_TIME) -> None:
"""
Release middle mouse.
waitTime: float.
"""
x, y = GetCursorPos()
screenWidth, screenHeight = GetScreenSize()
mouse_event(MouseEventFlag.MiddleUp | MouseEventFlag.Absolute, x * 65535 // screenWidth, y * 65535 // screenHeight, 0, 0)
time.sleep(waitTime)
def MiddleDragDrop(x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = OPERATION_WAIT_TIME) -> None:
"""
Simulate mouse middle button drag from point x1, y1 drop to point x2, y2.
x1: int.
y1: int.
x2: int.
y2: int.
moveSpeed: float, 1 normal speed, < 1 move slower, > 1 move faster.
waitTime: float.
"""
MiddlePressMouse(x1, y1, 0.05)
MoveTo(x2, y2, moveSpeed, 0.05)
MiddleReleaseMouse(waitTime)
@yinkaisheng
The text was updated successfully, but these errors were encountered: