java.lang.Object | +--Record
Records keyboard events in a class that can be replayed later.
Mouse events are not handled for various reasons. The justification is that mouse clicks on the windows title bar don't get reported (so handling these requires clumsy logic involving window events as well), and involve factors outside my control such as double-click speed and screen size. The real reason is that I encountered a lot of repaint problems when mouse clicks occurred that did not arise with keyboard input. As I strongly believe in providing keyboard short-cuts for all actions anyway this ommission does not cause me any problems.
I have chosen to capture the results in a java program, which must be compiled, rather than in a script that could be parsed and executed, becuase I find it convenient to be able to manually edit the results. For example, it is trivial to add loops around certain sections of the script.
To execute:
This class requires Java 1.3 becuase it uses the Robot and the AWTEventListener.
Method Summary | |
void |
eventDispatched(java.awt.AWTEvent ev)
Records keyboard events to Playback,java. |
static void |
main(java.lang.String[] args)
Runs the specified swing program and captures keyboard input events in a replayable java class. |
void |
run()
Called on shutdown to close the output. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static void main(java.lang.String[] args) throws java.lang.Exception
public void eventDispatched(java.awt.AWTEvent ev)
eventDispatched
in interface java.awt.event.AWTEventListener
public void run()
run
in interface java.lang.Runnable