I am developing a virtual keyboard application. Everything works fine except that what ever i write is written into the present application only not the one that is running behind.
I fell this is because ROBOT class in java only works for the application context that creates it.
Is there a work around for this?
Here is the code, i am trying to write ls in the terminal that is behind my java application:
Robot robot = new Robot();
robot.keyPress(KeyEvent.VK_ALT);
robot.keyPress(KeyEvent.VK_TAB);
robot.keyRelease(KeyEvent.VK_TAB);
robot.keyRelease(KeyEvent.VK_ALT);
robot.keyPress('l');
robot.keyRelease('l');
robot.keyPress('s');
robot.keyRelease('s');
robot.keyPress(KeyEvent.VK_ENTER);
robot.keyRelease(KeyEvent.VK_ENTER);