I am trying to make a small program that will move the mouse from the current position to the given position. Here is a method I can use that will move the mouse from one point to another, but without animation:
moveMouse(int x, int y);
This will move the mouse from the current coordinates to x, y on the screen without animation. Now my task is to move the mouse to this coordinate, but it should also show the mouse, moving one pixel at a time. I need to create a loop that moves the mouse cursor a few pixels x and y at a time, so this is what I thought:
public void moveMouseAnimation(x,y){
Now I need to find the correct x2 and y2 values so that the mouse moves in a straight line and finally reaches x and y. Can someone help me.
source share