Closed clFaster closed 7 months ago
Hello! Thanks for posting this issue! I will investigate it in the nearest future.
Same as the SimulateMouseMovement
Sorry about the delay, but I've finally managed to fix the issue.
Here's the code I used to test that the mouse coordinates don't actually change when moving by 0 pixels:
using var hook = new SimpleReactiveGlobalHook();
hook.MouseMoved
.Select(e => (e.Data.X, e.Data.Y))
.DistinctUntilChanged()
.Buffer(2, 1)
.Subscribe(coords => Console.WriteLine($"Mouse moved by: ({coords[1].X - coords[0].X}, {coords[1].Y - coords[0].Y})"));
_ = hook.RunAsync();
Thread.Sleep(1000);
var simulator = new EventSimulator();
for (int i = 0; i < 10000; i++)
{
simulator.SimulateMouseMovementRelative(0, 0);
}
With the current version of libuiohook I got the following output in one of the runs (the output is more or less random):
Mouse moved by: (-1, -1)
Mouse moved by: (-1, -1)
Mouse moved by: (-1, -1)
Mouse moved by: (-1, -1)
Mouse moved by: (-1, -1)
Mouse moved by: (-1, -1)
Mouse moved by: (-1, -1)
Mouse moved by: (-1, -1)
Mouse moved by: (-1, -1)
With the new version I've got no output which is expected.
I will release a new version with the fix shortly.
I've just released version 5.3.2 which fixes this bug so this issue can be closed.
Hi very nice lib! I've been experimenting with it to control mouse movement on Windows 11.
I'm encountering an issue where, when I execute the following code every second using a timer:
The mouse consistently moves to the top-left corner.
Environment:
Operating System: Windows 11 Library Version: 5.3.1
Additional Information: