在它说的地方**spacebarpressed**
,我想投射一个事件:
public static void main(String[] args) throws IOException, AWTException{
final Robot robot = new Robot();
robot.delay(2000);
while(true)
{
if( **spacebarpressed** ) {
robot.mousePress(InputEvent.BUTTON1_MASK);
robot.mouseRelease(InputEvent.BUTTON1_MASK);
robot.delay(50);
}
else {
robot.delay(50);
}
}
}