0

Possible Duplicate:
how to obtain mouse click coordinates outside my window in Java

Is it possible to detect a mouseClick with java no matter in what application you are?

For example, now i'm in my browser and soon i hit 'Post Your Question'

I would like to register that mouse click.

And if possible the detection between right and left mouse button would be even better.

possible?

edit:

It is not for a browser!!

I want to track my mouse behaviour while i'm playing a third person shooter.

asked Sep 7, 2012 at 15:33
4
  • 1
    What application feature do you wish to offer the end user? Commented Sep 7, 2012 at 15:35
  • Attempting to mess with the users input controls outside of your applets UI is a perfect way to ensure the user will at maximum visit a site once. Commented Sep 7, 2012 at 15:37
  • And isn't this sort of thing controlled at the OS level anyways? Because it routes the events to the 'focus' window? So wouldn't you have to register some sort of native handler? So we may need the target OS... You may have better luck making/using a Java-based browser that you can write plugins for, or something. Commented Sep 7, 2012 at 15:39
  • It's not to ensure the user will visit once :) I want to track my mouse behaviour while playing a game. Commented Sep 7, 2012 at 15:42

1 Answer 1

0

I don't know if there's a library for Java that allows you to record keyboard/mouse inputs and then replay them however, you can use java.awt.Robot to script any mouse/keyboard behavior:

http://docs.oracle.com/javase/6/docs/api/java/awt/Robot.html

Here's an example that types "Hi buddy" for you:

http://www.javalobby.org/java/forums/t84094.html

The only software that I've used that allows you to record keyboard/mouse inputs and then play them back to you is IBM Functional Tester.

answered Sep 7, 2012 at 20:47
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.