您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

机器人和按键

机器人和按键

代码在javafx.scene.input.KeyCode中定义为常量。

使用玻璃机器人,您可以使用不推荐使用的方法impl_getCode

Robot robot = com.sun.glass.ui.Application.GetApplication().createRobot();
robot.keyPress(KeyCode.A.impl_getCode());

您也可以使用FXRobot,它以KeyCodes作为参数:

FXRobot robot = FXRobotFactory.createRobot(scene);
robot.keyPress(javafx.scene.input.KeyCode.A);
其他 2022/1/1 18:27:53 有474人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶