learncodebygaming / pydirectinput

Python mouse and keyboard input automation for Windows using Direct Input.
Other
501 stars 88 forks source link

Mouse movement not working #59

Open Fabbbr0 opened 5 months ago

Fabbbr0 commented 5 months ago

''' import pydirectinput while True: pydirectinput.move(100, 0) print("hek") ''' The mouse dosent move

kezif commented 5 months ago

I tried several game, all in windowed mode. I checked how well library track mouse position, here are the results:

  1. Deep Rock Galactic (dx12)
    • mouse tracked perfectly
  2. cs2
    • mouse position didn't worked at all
  3. half life 2
    • mouse position changed but right away moved to the center of the window
  4. ultrakill
    • same as half life

From what I learned - Ben used SendInput win32 function. Also modern "hacks" (that utilize ahk) uses _mouseevent win32 function.

rdp commented 2 months ago

That's kinda odd, since the docs for mouse_event say Note This function has been superseded. Use [SendInput] instead. Maybe they are using a different path? See also https://stackoverflow.com/a/74720974/32453