Skip to content

Commit

Permalink
Gujarati phonetic layout (#562)
Browse files Browse the repository at this point in the history
added shift modifier characters
Add support for gujarati numerals

Co-authored-by: yogesh-b <[email protected]>
  • Loading branch information
Yogesh-B and yogesh-b authored Mar 3, 2024
1 parent 5e5937b commit a1de69b
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 0 deletions.
4 changes: 4 additions & 0 deletions check_layout.output
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ Layout doesn't define some important keys, missing: f11_placeholder, f12_placeho
# grek_qwerty
Duplicate keys: ;
1 warnings
# guj_phonetic_in
Duplicate keys: ટ, ડ
Layout doesn't define some important keys, missing: f11_placeholder, f12_placeholder
2 warnings
# hang_dubeolsik_kr
0 warnings
# hebr_1_il
Expand Down
3 changes: 3 additions & 0 deletions res/values/layouts.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<item>deva_alt</item>
<item>deva_inscript</item>
<item>grek_qwerty</item>
<item>guj_phonetic_in</item>
<item>hang_dubeolsik_kr</item>
<item>hebr_1_il</item>
<item>hebr_2_il</item>
Expand Down Expand Up @@ -74,6 +75,7 @@
<item>देवनागरी (हिंदी)-2</item>
<item>देवनागरी (हिंदी)-1</item>
<item>QWERTY (Greek)</item>
<item>ગુજરાતી ફોનેટિક - Gujarati Phonetic</item>
<item>두벌식 (Korean)</item>
<item>Hebrew 1</item>
<item>Hebrew 2</item>
Expand Down Expand Up @@ -126,6 +128,7 @@
<item>@xml/deva_alt</item>
<item>@xml/deva_inscript</item>
<item>@xml/grek_qwerty</item>
<item>@xml/guj_phonetic_in</item>
<item>@xml/hang_dubeolsik_kr</item>
<item>@xml/hebr_1_il</item>
<item>@xml/hebr_2_il</item>
Expand Down
47 changes: 47 additions & 0 deletions srcs/juloo.keyboard2/KeyModifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ public static Map_char modify_numpad_script(String numpad_script)
case "bengali": return map_char_numpad_bengali;
case "devanagari": return map_char_numpad_devanagari;
case "persian": return map_char_numpad_persian;
case "gujarati": return map_char_numpad_gujarati;
default: return map_char_none;
}
}
Expand Down Expand Up @@ -503,6 +504,31 @@ private static char map_char_shift(char c)
has the inconvenient of swapping i and ı on the keyboard. */
case 'ı': return 'İ';
case '₹': return '₨';
// Gujarati alternate characters
case 'અ': return 'આ';
case 'ઇ': return 'ઈ';
case 'િ': return 'ી';
case 'ઉ': return 'ઊ';
case 'ુ': return 'ૂ';
case 'એ': return 'ઐ';
case 'ે': return 'ૈ';
case 'ઓ': return 'ઔ';
case 'ો': return 'ૌ';
case 'ક': return 'ખ';
case 'ગ': return 'ઘ';
case 'ચ': return 'છ';
case 'જ': return 'ઝ';
case 'ટ': return 'ઠ';
case 'ડ': return 'ઢ';
case 'ન': return 'ણ';
case 'ત': return 'થ';
case 'દ': return 'ધ';
case 'પ': return 'ફ';
case 'બ': return 'ભ';
case 'મ': return 'ં';
case 'લ': return 'ળ';
case 'સ': return 'શ';
case 'હ': return 'ઃ';
default: return c;
}
}
Expand Down Expand Up @@ -1098,4 +1124,25 @@ public String apply(char c)
}
}
};

private static final Map_char map_char_numpad_gujarati =
new Map_char() {
public String apply(char c)
{
switch (c)
{
case '0': return "૦";
case '1': return "૧";
case '2': return "૨";
case '3': return "૩";
case '4': return "૪";
case '5': return "૫";
case '6': return "૬";
case '7': return "૭";
case '8': return "૮";
case '9': return "૯";
default: return null;
}
}
};
}
37 changes: 37 additions & 0 deletions srcs/layouts/guj_phonetic_in.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<keyboard name="ગુજરાતી ફોનેટિક - Gujarati Phonetic" script="gujarati">
<row>
<key key0="" key1="`" key2="1" key3="!" key4="esc"/>
<key key0="" key1="~" key2="2" key3="\@" key4="\#"/>
<key key0="" key1="" key2="3" key3="$" key4=""/>
<key key0="" key1="" key2="4" key3="" key4=""/>
<key key0="" key1="" key2="5" key3="%"/>
<key key0="" key2="6" key3="^"/>
<key key0="" key1="" key2="7" key3="&amp;"/>
<key key0="િ" key1="" key2="8" key3="*" key4=""/>
<key key0="" key1="" key2="9" key3="(" key4=")"/>
<key key0="" key1="" key2="0" key4=""/>
</row>
<row>
<key shift="0.5" key0="" key1="tab" key3=""/>
<key key0="" key1="" key4=""/>
<key key0="" key1=""/>
<key key0="" key1="" key3=""/>
<key key0="" key2="-" key3="_"/>
<key key0="" key2="=" key3="+"/>
<key key0="" key3="{" key4="}"/>
<key key0="" key1="" key2="" key3="[" key4="]"/>
<key key0="" key1="" key2="|" key3="\\" key4=""/>
</row>
<row>
<key width="1.5" key0="shift" key2="loc capslock"/>
<key key0="" key1="જ્ઞ" key2="" key3="" key4=""/>
<key key0="" key1="ક્ષ" key2="" key3="" key4=""/>
<key key0="" key2="&lt;" key3="."/>
<key key0="" key2=">" key3=","/>
<key key0="" key2="\?" key3="/"/>
<key key0="" key2=":" key3=";"/>
<key key0="" key1="" key2="&quot;" key3="'" key4="" key6=""/>
<key width="1.5" key0="backspace" key2="delete"/>
</row>
</keyboard>

0 comments on commit a1de69b

Please sign in to comment.