Retrieves the Keys enum constant corresponding to the given Unicode character. @param key unicode character code @return special key linked to the character code, or null if not found
(char key)
| 205 | * @return special key linked to the character code, or null if not found |
| 206 | */ |
| 207 | public static @Nullable Keys getKeyFromUnicode(char key) { |
| 208 | for (Keys unicodeKey : values()) { |
| 209 | if (unicodeKey.charAt(0) == key) { |
| 210 | return unicodeKey; |
| 211 | } |
| 212 | } |
| 213 | return null; |
| 214 | } |
| 215 | } |