Skip to content

Commit a1de69b

Browse files
Yogesh-Byogesh-b
and
yogesh-b
authored
Gujarati phonetic layout (#562)
added shift modifier characters Add support for gujarati numerals Co-authored-by: yogesh-b <yogesh@improwised.com>
1 parent 5e5937b commit a1de69b

File tree

4 files changed

+91
-0
lines changed

4 files changed

+91
-0
lines changed

check_layout.output

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ Layout doesn't define some important keys, missing: f11_placeholder, f12_placeho
5050
# grek_qwerty
5151
Duplicate keys: ;
5252
1 warnings
53+
# guj_phonetic_in
54+
Duplicate keys: ટ, ડ
55+
Layout doesn't define some important keys, missing: f11_placeholder, f12_placeholder
56+
2 warnings
5357
# hang_dubeolsik_kr
5458
0 warnings
5559
# hebr_1_il

res/values/layouts.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
<item>deva_alt</item>
2323
<item>deva_inscript</item>
2424
<item>grek_qwerty</item>
25+
<item>guj_phonetic_in</item>
2526
<item>hang_dubeolsik_kr</item>
2627
<item>hebr_1_il</item>
2728
<item>hebr_2_il</item>
@@ -74,6 +75,7 @@
7475
<item>देवनागरी (हिंदी)-2</item>
7576
<item>देवनागरी (हिंदी)-1</item>
7677
<item>QWERTY (Greek)</item>
78+
<item>ગુજરાતી ફોનેટિક - Gujarati Phonetic</item>
7779
<item>두벌식 (Korean)</item>
7880
<item>Hebrew 1</item>
7981
<item>Hebrew 2</item>
@@ -126,6 +128,7 @@
126128
<item>@xml/deva_alt</item>
127129
<item>@xml/deva_inscript</item>
128130
<item>@xml/grek_qwerty</item>
131+
<item>@xml/guj_phonetic_in</item>
129132
<item>@xml/hang_dubeolsik_kr</item>
130133
<item>@xml/hebr_1_il</item>
131134
<item>@xml/hebr_2_il</item>

srcs/juloo.keyboard2/KeyModifier.java

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ public static Map_char modify_numpad_script(String numpad_script)
103103
case "bengali": return map_char_numpad_bengali;
104104
case "devanagari": return map_char_numpad_devanagari;
105105
case "persian": return map_char_numpad_persian;
106+
case "gujarati": return map_char_numpad_gujarati;
106107
default: return map_char_none;
107108
}
108109
}
@@ -503,6 +504,31 @@ private static char map_char_shift(char c)
503504
has the inconvenient of swapping i and ı on the keyboard. */
504505
case 'ı': return 'İ';
505506
case '₹': return '₨';
507+
// Gujarati alternate characters
508+
case 'અ': return 'આ';
509+
case 'ઇ': return 'ઈ';
510+
case 'િ': return 'ી';
511+
case 'ઉ': return 'ઊ';
512+
case 'ુ': return 'ૂ';
513+
case 'એ': return 'ઐ';
514+
case 'ે': return 'ૈ';
515+
case 'ઓ': return 'ઔ';
516+
case 'ો': return 'ૌ';
517+
case 'ક': return 'ખ';
518+
case 'ગ': return 'ઘ';
519+
case 'ચ': return 'છ';
520+
case 'જ': return 'ઝ';
521+
case 'ટ': return 'ઠ';
522+
case 'ડ': return 'ઢ';
523+
case 'ન': return 'ણ';
524+
case 'ત': return 'થ';
525+
case 'દ': return 'ધ';
526+
case 'પ': return 'ફ';
527+
case 'બ': return 'ભ';
528+
case 'મ': return 'ં';
529+
case 'લ': return 'ળ';
530+
case 'સ': return 'શ';
531+
case 'હ': return 'ઃ';
506532
default: return c;
507533
}
508534
}
@@ -1098,4 +1124,25 @@ public String apply(char c)
10981124
}
10991125
}
11001126
};
1127+
1128+
private static final Map_char map_char_numpad_gujarati =
1129+
new Map_char() {
1130+
public String apply(char c)
1131+
{
1132+
switch (c)
1133+
{
1134+
case '0': return "૦";
1135+
case '1': return "૧";
1136+
case '2': return "૨";
1137+
case '3': return "૩";
1138+
case '4': return "૪";
1139+
case '5': return "૫";
1140+
case '6': return "૬";
1141+
case '7': return "૭";
1142+
case '8': return "૮";
1143+
case '9': return "૯";
1144+
default: return null;
1145+
}
1146+
}
1147+
};
11011148
}

srcs/layouts/guj_phonetic_in.xml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<keyboard name="ગુજરાતી ફોનેટિક - Gujarati Phonetic" script="gujarati">
3+
<row>
4+
<key key0="" key1="`" key2="1" key3="!" key4="esc"/>
5+
<key key0="" key1="~" key2="2" key3="\@" key4="\#"/>
6+
<key key0="" key1="" key2="3" key3="$" key4=""/>
7+
<key key0="" key1="" key2="4" key3="" key4=""/>
8+
<key key0="" key1="" key2="5" key3="%"/>
9+
<key key0="" key2="6" key3="^"/>
10+
<key key0="" key1="" key2="7" key3="&amp;"/>
11+
<key key0="િ" key1="" key2="8" key3="*" key4=""/>
12+
<key key0="" key1="" key2="9" key3="(" key4=")"/>
13+
<key key0="" key1="" key2="0" key4=""/>
14+
</row>
15+
<row>
16+
<key shift="0.5" key0="" key1="tab" key3=""/>
17+
<key key0="" key1="" key4=""/>
18+
<key key0="" key1=""/>
19+
<key key0="" key1="" key3=""/>
20+
<key key0="" key2="-" key3="_"/>
21+
<key key0="" key2="=" key3="+"/>
22+
<key key0="" key3="{" key4="}"/>
23+
<key key0="" key1="" key2="" key3="[" key4="]"/>
24+
<key key0="" key1="" key2="|" key3="\\" key4=""/>
25+
</row>
26+
<row>
27+
<key width="1.5" key0="shift" key2="loc capslock"/>
28+
<key key0="" key1="જ્ઞ" key2="" key3="" key4=""/>
29+
<key key0="" key1="ક્ષ" key2="" key3="" key4=""/>
30+
<key key0="" key2="&lt;" key3="."/>
31+
<key key0="" key2=">" key3=","/>
32+
<key key0="" key2="\?" key3="/"/>
33+
<key key0="" key2=":" key3=";"/>
34+
<key key0="" key1="" key2="&quot;" key3="'" key4="" key6=""/>
35+
<key width="1.5" key0="backspace" key2="delete"/>
36+
</row>
37+
</keyboard>

0 commit comments

Comments
 (0)