From a1de69bcc4c600ccd149ce8311e726cbcea38e6e Mon Sep 17 00:00:00 2001 From: Yogesh-B <41276813+Yogesh-B@users.noreply.github.com> Date: Mon, 4 Mar 2024 03:42:52 +0530 Subject: [PATCH] Gujarati phonetic layout (#562) added shift modifier characters Add support for gujarati numerals Co-authored-by: yogesh-b --- check_layout.output | 4 +++ res/values/layouts.xml | 3 ++ srcs/juloo.keyboard2/KeyModifier.java | 47 +++++++++++++++++++++++++++ srcs/layouts/guj_phonetic_in.xml | 37 +++++++++++++++++++++ 4 files changed, 91 insertions(+) create mode 100644 srcs/layouts/guj_phonetic_in.xml diff --git a/check_layout.output b/check_layout.output index 46f3254..6f667d0 100644 --- a/check_layout.output +++ b/check_layout.output @@ -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 diff --git a/res/values/layouts.xml b/res/values/layouts.xml index 36a3731..6d05fa0 100644 --- a/res/values/layouts.xml +++ b/res/values/layouts.xml @@ -22,6 +22,7 @@ deva_alt deva_inscript grek_qwerty + guj_phonetic_in hang_dubeolsik_kr hebr_1_il hebr_2_il @@ -74,6 +75,7 @@ देवनागरी (हिंदी)-2 देवनागरी (हिंदी)-1 QWERTY (Greek) + ગુજરાતી ફોનેટિક - Gujarati Phonetic 두벌식 (Korean) Hebrew 1 Hebrew 2 @@ -126,6 +128,7 @@ @xml/deva_alt @xml/deva_inscript @xml/grek_qwerty + @xml/guj_phonetic_in @xml/hang_dubeolsik_kr @xml/hebr_1_il @xml/hebr_2_il diff --git a/srcs/juloo.keyboard2/KeyModifier.java b/srcs/juloo.keyboard2/KeyModifier.java index 94f096b..146c1bd 100644 --- a/srcs/juloo.keyboard2/KeyModifier.java +++ b/srcs/juloo.keyboard2/KeyModifier.java @@ -103,6 +103,7 @@ public final class KeyModifier 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; } } @@ -503,6 +504,31 @@ public final class KeyModifier 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; } } @@ -1098,4 +1124,25 @@ public final class KeyModifier } } }; + + 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; + } + } + }; } diff --git a/srcs/layouts/guj_phonetic_in.xml b/srcs/layouts/guj_phonetic_in.xml new file mode 100644 index 0000000..a2e82cf --- /dev/null +++ b/srcs/layouts/guj_phonetic_in.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file