Get in real time if the cursor moves

0

Good I want to make a script to drag and drop, I have one done but it works with Sleep and I want to improve it by making it execute: mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0); when I move the mouse to the  limit that I point to a variable (it is not a constant position, that is, I want to move the mouse in any direction and only release when the variable has increased).

example: at the time of me doing if (GetAsyncKeyState(VK_LBUTTON)) store the current position in a variable 0 and go detecting through the loop while if the mouse has moved 10 places away from the variable 0 , if the variable 0 increases to 10 run mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);

Sleep example:

 while (1)
{

    if (GetAsyncKeyState(VK_LBUTTON)) {

        Sleep(60);
        mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);

    }


}

How could I handle the variables in positions?

    
asked by Kiyosaki 12.09.2018 в 15:40
source

0 answers