--- old/src/java.desktop/share/classes/java/awt/Robot.java 2017-09-21 14:04:16.771886600 +0530 +++ new/src/java.desktop/share/classes/java/awt/Robot.java 2017-09-21 14:04:15.338576700 +0530 @@ -377,6 +377,39 @@ afterEvent(); } + /** + * Presses a given unicode key. The key should be released using the + * {@code keyReleaseUnicode} method. + *

+ * + * @param key unicode to press + * @throws IllegalArgumentException if {@code key} is not + * a valid unicode key + * @see #keyReleaseUnicode(int) + * @see java.awt.event.KeyEvent + */ + public synchronized void keyPressUnicode(int key) { + checkKeycodeArgument(key); + peer.keyPressUnicode(key); + afterEvent(); + } + + /** + * Releases a given unicode key. + *

+ * + * @param key unicode to release + * @throws IllegalArgumentException if {@code key} is not a + * valid key + * @see #keyPressUnicode(int) + * @see java.awt.event.KeyEvent + */ + public synchronized void keyReleaseUnicode(int key) { + checkKeycodeArgument(key); + peer.keyReleaseUnicode(key); + afterEvent(); + } + private void checkKeycodeArgument(int keycode) { // rather than build a big table or switch statement here, we'll // just check that the key isn't VK_UNDEFINED and assume that the