List of utility methods to do Robot
void | awtRobotKeyPress(final Robot robot, final int keyCode, final int msDelay) awt Robot Key Press robot.keyPress(keyCode); robot.delay(msDelay); |
void | awtRobotKeyRelease(final Robot robot, final int keyCode, final int msDelay) awt Robot Key Release robot.keyRelease(keyCode); robot.delay(msDelay); |
int | keyPress(final int i, final Robot robot, final boolean press, final int keyCode, final int msDelay) No validation is performed .. final long t0 = System.currentTimeMillis(); if (press) { awtRobotKeyPress(robot, keyCode, msDelay); } else { awtRobotKeyRelease(robot, keyCode, msDelay); return (int) (System.currentTimeMillis() - t0); |
void | keyPressWithCtrl(Robot r, int key) key Press With Ctrl if (r == null) { return; r.keyPress(KeyEvent.VK_CONTROL); r.keyPress(key); r.keyRelease(key); r.keyRelease(KeyEvent.VK_CONTROL); r.delay(100); ... |
void | pressKeyCombo(Robot robot, int... codes) press Key Combo Deque<Integer> keyCodes = new ArrayDeque<Integer>(); for (int code : codes) { robot.keyPress(code); keyCodes.push(code); for (int key : keyCodes) robot.keyRelease(key); |