/** * Types a character * * @param c The character to type */ public void type(char c) { handler.typeKey(c); }
/** * 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); }
/** * 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); }
/** * Simulates a key press * * <p>Note: The key is not automatically released, so this must be matched with a <code> * release(keycode)</code> * * @param keycode */ public void press(int keycode) { handler.pressKey(keycode); }