Skip to content

Commit

Permalink
Add romanian diacritics
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexBurdu authored and Alex committed Mar 22, 2022
1 parent 2334add commit 9fb7f74
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion server/src/main/java/com/genymobile/scrcpy/KeyComposition.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
*/
public final class KeyComposition {

private static final String KEY_DEAD_GRAVE = "\u0300";
private static final String KEY_DEAD_ACUTE = "\u0301";
private static final String KEY_DEAD_BREVE = "\u0306"; // ă Ă
private static final String KEY_DEAD_CIRCUMFLEX = "\u0302";
private static final String KEY_DEAD_COMMA_BELOW = "\u0326"; // ș Ș ț Ț
private static final String KEY_DEAD_GRAVE = "\u0300";
private static final String KEY_DEAD_TILDE = "\u0303";
private static final String KEY_DEAD_UMLAUT = "\u0308";

Expand Down Expand Up @@ -51,6 +53,14 @@ private static String umlaut(char c) {
return KEY_DEAD_UMLAUT + c;
}

private static String commaBelow(char c) {
return KEY_DEAD_COMMA_BELOW + c;
}

private static String breve(char c) {
return KEY_DEAD_BREVE + c;
}

private static Map<Character, String> createDecompositionMap() {
Map<Character, String> map = new HashMap<>();
map.put('À', grave('A'));
Expand Down Expand Up @@ -169,6 +179,14 @@ private static Map<Character, String> createDecompositionMap() {
map.put('ẍ', umlaut('x'));
map.put('ẗ', umlaut('t'));

map.put('Ă', breve('A'));
map.put('ă', breve('a'));

map.put('Ș', commaBelow('S'));
map.put('ș', commaBelow('s'));
map.put('Ț', commaBelow('T'));
map.put('ț', commaBelow('t'));

return map;
}
}

0 comments on commit 9fb7f74

Please sign in to comment.