问题描述:

I was trying to simulate TAB KEY using class java.awt.Robot; in Windows8 but it does not work(just like no key pressed). I had tried in OS X Yosemite, it worked perfectly.

try {

Robot robot = new Robot();

robot.setAutoDelay(50);

robot.keyPress(KeyEvent.VK_TAB);

robot.keyRelease(KeyEvent.VK_TAB);

}catch (AWTException e){}

Someone can tell me why it does not work? and how can I simulate tab key in Windows8 ?

One more question, what does this method do?

robot.waitForIdle()

相关阅读:
Top