-
-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SendInput for mouse movement on Windows #26
Comments
I have done a crude test to see if I could get SendInput working This works for relative movements only
I explored how that snippet could be adapted to work for absolute positioning on the display
I don't know if you would want to create some more methods within mouse.c or modify the existing moveMouse method and maybe add some flags on the params. I have not thoroughly tested platform support but it works well on Windows 10 for me locally. This script has some great examples in it I don't mind raising a PR but this is only prototype code and not very production friendly. I can work on it more if you want |
Hi @Reiss-Cashmore 👋 Just modify the Thanks for your support! |
moveMouse refactor to use sendInput on Windows (#26)
Short overview
The current implementation uses SetCursorPos for mouse movment.
We might consider using SendInput like we do for scrolling and keyboard input.
Use case
Automating multimedia applications like e.g. games
Detailed description
As reported in nut-tree/nut.js#168 it is currently not possible to cause in-game mouse movement with nut.js, although desktop mouse movement works fine.
A possible reason for this could be the usage of
SetCursorPos
instead ofSendInput
.Following the above mentioned docs it seems like
SetCursorPos
is more desktop centered, whereasSendInput
actually inserts events into the keyboard and mouse inputstream.The text was updated successfully, but these errors were encountered: