This is the mail archive of the
mailing list for the Mauve project.
Re: Tweaking default java.awt.Robot settings
Lillian Angel wrote:
David Herron wrote:
[resending because the mailing list thingy told me I had to use only
plain text messages...]
Hmmm.. here's the meat of the test
public void runTest(int code, char chr)
KeyEvent e = new KeyEvent(f, KeyEvent.KEY_PRESSED, 0, 0, code,
h.check(key, (int) chr);
I don't understand this. If you're going to create a Java event why
use Robot, or vice versa...?
The test was done this way to determine if the right key was pressed.
See the inner class (myFrame) which has 1 function (keyDown) which
sets a variable (key) to the key that was pressed.
While it might be incorrect, I am unsure how else we can determine
that the correct key was pressed without dispatching an event.
Maybe I misread the code in my brief look.
The side effect of using Robot to keyPress and keyRelease should be the
dispatch of two KeyEvent's. That's why I said those two lines should
go, because the way I read it they're masking whether Robot successfully
delivered the KeyEvent's.
- David Herron