Languages

Java - simple auto mouse mover application

3 points
Asked by:
LionRanger
461

How to write simple automatic mouse movement app in java?

Is it possible to write very simple app to do only that, without any additional logic.

I am only interested in couple of mouse moves from point 1 to point 2 on my computer screen. On the web I can find kind of complicated apps that do a lot of different stuff.

1 answer
3 points
Answered by:
Root-ssh
178430

Quick solution:

Output:

This simple app will do exactly what you ask in question, move the mouse from one point to another. In this case from point(300px, 300px) to point(200px, 200px) and back again - it will be repeated 3 times. 

Flow:

  • from point(300px, 300px) to point(200px, 200px)
  • sleep 3 seconds
  • from point(200px, 200px) to point(300px, 300px)
  • sleep 3 seconds
  • repeat again

We can use while (true) instead of for loop, but before using while true - think twice and add some break condition.

This simple app can be easily modified and we can add some more features like auto click. Java has nice API to do those things.

0 commentsAdd comment
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join