We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6aadc5a commit 5cf4c8fCopy full SHA for 5cf4c8f
src/win32/mouse.c
@@ -38,7 +38,15 @@ int CalculateAbsoluteCoordinateY(int y)
38
*/
39
void moveMouse(MMPoint point)
40
{
41
- SetCursorPos ((int)point.x, (int)point.y);
+ INPUT mouseInput;
42
+ mouseInput.type = INPUT_MOUSE;
43
+ mouseInput.mi.dx = CalculateAbsoluteCoordinateX(point.x);
44
+ mouseInput.mi.dy = CalculateAbsoluteCoordinateY(point.y);
45
+ mouseInput.mi.mouseData = 0;
46
+ mouseInput.mi.time = 0;
47
+ mouseInput.mi.dwFlags = MouseEventFlags.MOUSEEVENTF_MOVE | MouseEventFlags.MOUSEEVENTF_ABSOLUTE;
48
+ mouseInput.mi.dwExtraInfo = 0;
49
+ SendInput(1, &mouseInput, sizeof(mouseInput));
50
}
51
52
void dragMouse(MMPoint point, const MMMouseButton button)
0 commit comments