I have done the player part with utils such as java.awt.Robot()
which emulates basic human mouse/keyboard output commands, reading an XML file.
I am stuck at the part where I have to record that XML file. I have no idea of which Class I can use to do the opposite of Robot() If yo have any FemaleRobot() for me I would be very happy :D
The only thing in this direction I have so far is :
while (true) {
Point pos = MouseInfo.getPointerInfo().getLocation();
System.out.println(pos.x+" x "+pos.y);
}
which is not much and not really what I want ^_^, I don't know how to use a Mouse/KeyListener since it would require a Component. If it is the only way, what Compoment do I use as I don't want any graphical java implementation? Should I create a phony Component anyway? Which one?
e.g. I want my recorder to write in the XML how I click on my ubuntu desktop or press enter on firefox.
I guess it's clear, if not I will be checking the answers a lot. Have a nice day and thanks for reading this.
Try jnativehook lib: http://code.google.com/p/jnativehook/wiki/examples
It is very easy to use and may meet your needs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With