2

Purpose: I want to have the relative movement of my mouse even when she is on the border of my screen (so I can't compute the vector between 2 moment).

Application: I want to make a helper for mortar shooting in a game called 'squad', you control the mortar with your mouse. I checked the behavior of the mouse within the game and when you move the camera around, when the mouse reach the border of the screen you can keep on looking around with no problem but the mouse position is obviously not updated since it is at the same position.

I tried the following library:

  • Pyautogui: Have the function for it but doesn't handle near-broder mouse since I guess it calculate the relative movement of the mouse from a past and actual position
  • Pygame: can't catch the mouse relative movement when it's outside of the Windows
  • Pymouse: doesn't have the function I search
  • Pywin32: doesn't have the function I search
  • Pypiwin32: doesn't have the function I search

A way to make it work: I was able to make it work by teleporting the mouse in the middle of the screen when it's reaching the border of the game (which doesn't cause trouble because apparently the game doesn't compute it to make your mortar move), but I'm afraid that I would get banned because some anticheat-tool would see my mouse teleporting around (even if this wouldn't be cheating).

Now I'm considering using a library to read the USB Information that the mouse send.

After 6+ hours of research I'm running out of possibilities to make it and before loosing more time I would like to know if anyone as a way to do it (in Python or any other language).

Paul Roub
  • 36,322
  • 27
  • 84
  • 93
Ratchet
  • 21
  • 2

1 Answers1

0

Rather than warping the cursor to the center of the screen, could you just warp it back a little from the edge? It seems like anti-cheat software would have a harder time detecting that.

mermaldad
  • 322
  • 2
  • 7
  • At first I tried to move it just a little bit towards the center when near border but it appear that if you move your mouse too fast you will still hit the border and therefore lost a certain 'amount' of relative movement... I know that it's hard for anti-cheat to detect this kind of stuff but I don't want to risk my steam account ^^ – Ratchet Nov 04 '19 at 22:52