Keys(Keys key) { this(key.charAt(0)); }
OperaMobileKeys(Keys alias) { keyCode = alias.charAt(0); }
/* package */ static int getKeyEventFromUnicodeKey(char key) { if (key == '\b') { return KeyEvent.KEYCODE_DEL; } else if (key == '\r') { return KeyEvent.KEYCODE_ENTER; } for (Keys seleniumKey : keyMapping.keySet()) { if (seleniumKey.charAt(0) == key) { return keyMapping.get(seleniumKey); } } return -1; } }
/** * Get the special key representation, {@link Keys}, of the supplied character if there is one. If * there is no special key tied to this character, null will be returned. * * @param key unicode character code * @return special key linked to the character code, or null if character is not a special key */ private static Keys getKeyFromUnicode(char key) { for (Keys unicodeKey : Keys.values()) { if (unicodeKey.charAt(0) == key) { return unicodeKey; } } return null; }
/** * Get the special key representation, {@link Keys}, of the supplied character if there is one. If * there is no special key tied to this character, null will be returned. * * @param key unicode character code * @return special key linked to the character code, or null if character is not a special key */ public static Keys getKeyFromUnicode(char key) { for (Keys unicodeKey : values()) { if (unicodeKey.charAt(0) == key) { return unicodeKey; } } return null; } }