User error or bug re: move (relative mouse movement)? 路 Issue #7 路 ReggX/pydirectinput 您所在的位置:网站首页 pydirectinputmoveRel User error or bug re: move (relative mouse movement)? 路 Issue #7 路 ReggX/pydirectinput

User error or bug re: move (relative mouse movement)? 路 Issue #7 路 ReggX/pydirectinput

2024-07-12 11:15| 来源: 网络整理| 查看: 265

Hi thanks so much for your work updating pydirectinput and I was excited to find it on PyPi.

I submitted a PR to this project, wingman-ai, to implement pydirectinput-rgx (pyautogui is still used in the alternative for mac users of the project), and encountered unexpected behavior with relative mouse movement. Wondering if this is user error or a bug.

You can see the most recent PR here: ShipBit/wingman-ai@3569bff

I was having an issue where using the move(x,y) or move(x,y,duration=[duration]) functions were not using relative movement. If, for example, the current mouse position was 900,600, and x,y was 0, 100, the cursor would move to 0,100 not 900,700. I tested by running print statements of the current mouse position (position()), ensuring x, y were integers, and then printing the final mouse postion, and with 0,-100; 100,0; -100,0; 0,100 and each had the same issue when running move(x,y) or move(x,y,duration) with putting the cursor up at the top left corner of the screen with various offsets. I also tried setting duration to 0.5, 1, and 2 and although I could see the cursor moving slower, it still went to the same place.

As you can see in the PR, I reverted by calculating a new absolute position manually and then using the moveTo function instead, and that works fine.

Is this a bug or user error? Thanks!



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有