/** * 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); }
/** * 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); }
/** * Release a specific symbol (such as SHIFT or CTRL). * * @param symbol symbol name */ private void symbolRelease(String symbol) { if (nativeKeyboard != null) nativeKeyboard.symbolRelease(symbol); }
/** * Press a specific symbol (such as SHIFT or CTRL). * * @param symbol symbol name */ private void symbolPress(String symbol) { if (nativeKeyboard != null) nativeKeyboard.symbolPress(symbol); }