Example #1
0
 /**
  * Release a specific key using its keycode.
  *
  * @param keycode the Java keycode, all available keycode can be found in java.awt.event.KeyEvent
  *     class (VK_A, VK_SPACE, ...)
  * @see java.awt.event.KeyEvent
  */
 public void keyRelease(int keycode) {
   /* AltGr does not seems to work with robot, handle it via our
    * JNI code
    */
   if (keycode == KeyEvent.VK_ALT_GRAPH) {
     symbolRelease("altgr");
   } else {
     robot.keyRelease(keycode);
   }
 }
Example #2
0
  /**
   * Release a specific key using its char representation.
   *
   * @param key char representation of the key
   */
  public void keyRelease(char key) {
    /* check for CTRL+X where X is [A-Z]
     * CTRL+A = 1, A = 65
     */
    if (key >= 1 && key <= 0x1A) {
      key = (char) (key + 64);
      robot.keyRelease(key);
      return;
    }

    if (nativeKeyboard != null) nativeKeyboard.keyRelease(key);
  }