record mouse movements, clicks and keyboard input with Java or C++
<p>I want to be able to record mouse movements, clicks and keyboard input from a user.  It would be great if it was a cross platform solution.</p>

<p>I'd like to get back something like this (pseudo code):</p>

<p>mouse moved to 500, 500
mouse double clicked 
mouse moved to 800, 300
mouse left clicked
keyboard typed "Hello World"</p>

<p>Does either C++ or Java have any classes that can do this?  If I was using C++, I would probably working with the QT framework. </p>

<p>Edit:</p>

<p>I should have said this originally, but I want to record the movements and clicks outside of the applications gui, so on the desktop too.</p>
