4

Anyways, I'm building a bot to run in the background. This bot requires me to click. Of course, I want to be able to do other things while the bot is running.

So I was wondering if it was possible for me to simulate a mouse click at a certain position on an inactive window.

If this is possible, I would greatly appreciate it if any of you could help me.

1 Answer 1

1

java.awt.Robot

Clicking into an active window is going to activate it, though.

Sign up to request clarification or add additional context in comments.

4 Comments

Correct me if I'm wrong, but I don't think this class works for clicking on inactive windows
why? it drives the mouse pointer by screen coordinates, and then 'clicks' (the coordinates are screen ones)
The problem is, it has to be in the background. Is there any way I can have it simulate clicks while it's in the background?
Well, so the frame is actually minimized (for instance), you don't have much of a chance, simulating alt+tab, taking a screenshot, processing to see if the title is there and ultimately running it. Alternatively, use more than a single monitor and keep the window in front all the time... starting a VM (not java) and running its own OS w/ a virtual screen can be an option too. What you want is running a robot but interfering meanwhile.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.