I am attempting to send native MouseEvents and KeyEvents to a java application.
I've figured out how to do it in AWT, like this:
KeyEvent k = new KeyEvent(j, KeyEvent.KEY_TYPED, 1, 0, KeyEvent.VK_UNDEFINED, 'k');
j.requestFocus();
java.awt.Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(k);
Where j is your component.
The thing is though, this only works on Java/AWT components. I'm attempting to emulate a mouse press or key press in DJ Native Browser, but it doesn't work here, possibly because this browser doesn't use AWT. Is there a way I can send a native windows event to the application without affecting my actual keyboard and mouse? Obviously awt.Robot
is the obvious answer but it DOES affect the windows mouse and keyboard.
If the way to do it is operating-system dependent, that is OK. As long as it works on windows 64 bit, there is no issue with that.
Another possibility would be a java swing browser that runs on AWT, but I have yet to find a working, up-to-date browser besides DJNative, let alone one that runs on AWT.
Suggestions??
Thanks