void attachTo(@Nonnull java.awt.Robot newRobot) { robot = newRobot; if (delayBetweenEvents < 0) { delayBetweenEvents = this.robot.getAutoDelay(); } else { updateRobotAutoDelay(); } }
/** * Updates the value representing the millisecond count in between generated events. Usually just * set to 100-200 if you want to slow down the playback to simulate actual user input. The default * is 60 milliseconds. * * <p>To change the speed of a GUI test, you need to change the values of both {@code * delayBetweenEvents} and {@code eventPostingDelay}. * * @param ms the millisecond count in between generated events. It should be between -1 and 60000. * @see #eventPostingDelay(int) */ public void delayBetweenEvents(int ms) { delayBetweenEvents = valueToUpdate(ms, -1, 60000); if (robot != null) { updateRobotAutoDelay(); } }