Example #1
0
 /**
  * Holds a key down for the given time
  *
  * @param keycode The keycode, such as KeyEvent.VK_X
  * @param millis The time to hold the key down for in milliseconds
  */
 public void hold(int keycode, int millis) {
   handler.pressKey(keycode);
   Utils.sleep(millis);
   handler.releaseKey(keycode);
 }
Example #2
0
 /**
  * Simulates a key release
  *
  * <p>This method is generally only used after calling <code>press(keycode)</code> to manually
  * simulate a key press.
  *
  * @param keycode
  */
 public void release(int keycode) {
   handler.releaseKey(keycode);
 }