import java.awt.AWTException;
import java.awt.Robot;
import java.awt.event.KeyEvent;
...
try {
Robot robot = new Robot();
// ส่ง key A ไป
robot.keyPress(KeyEvent.VK_A);
} catch (AWTException e) {
e.printStackTrace();
}
...
Reference:
Sending keystrokes to GUI applications
No comments:
Post a Comment