Skip to content

Commit

Permalink
Merge pull request #106 from DarkLii/master
Browse files Browse the repository at this point in the history
修复拖拽窗口到10,10不生效的问题
  • Loading branch information
mikigo authored Sep 5, 2024
2 parents bc76a07 + 7efba69 commit a4c4566
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/mouse_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@ def drag_to(cls, _x, _y, duration=0.4, delay=1):
:return:
"""
logger.debug(f"鼠标从当前位置拖拽到坐标 ({_x, _y})")
# 默认duration=0.4时,拖拽到_y<=95不生效,将拖拽的时长调整为0.9,
# 至于为啥_y<=95且duration<=0.8 时不生效,目前还不清楚,先解决问题
if _y <= 95:
duration = 0.9
pyautogui.dragTo(x=int(_x), y=int(_y), duration=duration, mouseDownUp=True)
sleep(delay)

Expand Down

0 comments on commit a4c4566

Please sign in to comment.