public void sendKeysInstant(final String text, final boolean pressEnter) { for (final char c : text.toCharArray()) { sendKey(c, 0); } if (pressEnter) { sendKey((char) KeyEvent.VK_ENTER, 0); } }
public void sendKeys( final String text, final boolean pressEnter, final int minDelay, final int maxDelay) { final char[] chs = text.toCharArray(); for (final char element : chs) { sendKey(element, random(minDelay, maxDelay)); sleepNoException(random(minDelay, maxDelay)); } if (pressEnter) { sendKey((char) KeyEvent.VK_ENTER, random(minDelay, maxDelay)); } }
public void sendKey(final char c) { sendKey(c, 0); }