Exemplo n.º 1
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);
  }
Exemplo n.º 2
0
  /**
   * Press a specific key using its char representation.
   *
   * @param key char representation of the key
   */
  public void keyPress(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.keyPress(key);
      return;
    }

    nativeKeyboard.keyPress(key);
  }
Exemplo n.º 3
0
 /**
  * Release a specific symbol (such as SHIFT or CTRL).
  *
  * @param symbol symbol name
  */
 private void symbolRelease(String symbol) {
   if (nativeKeyboard != null) nativeKeyboard.symbolRelease(symbol);
 }
Exemplo n.º 4
0
 /**
  * Press a specific symbol (such as SHIFT or CTRL).
  *
  * @param symbol symbol name
  */
 private void symbolPress(String symbol) {
   if (nativeKeyboard != null) nativeKeyboard.symbolPress(symbol);
 }