📜  在机器人 java 代码示例中按 enter

📅  最后修改于: 2022-03-11 14:52:26.803000             🧑  作者: Mango

代码示例1
public static void pressEnterKey() {
                Robot robot1 = null;
                try {
                    robot1 = new Robot();
                } catch (AWTException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
                robot1.keyPress(KeyEvent.VK_ENTER);
                robot1.keyRelease(KeyEvent.VK_ENTER);
            }