I write a basic mouse movement code. I set cursor to move 50px left each time. But its move more than I set.
Code:
#include <iostream>
#include <Windows.h>
using namespace std;
int main() {
POINT p;
SetCursorPos(1920, 540);
while (1) {
mouse_event(MOUSEEVENTF_MOVE, -50, 0, 0, 0);
GetCursorPos(&p);
cout << p.x << endl;
Sleep(2000);
}
}
Output:
I tried to rewrite it from scratch.
Output should be:
1870
1820
1770
1720
etc...
