diff --git a/java/res/xml-v16/key_nepali_romanized3_shift_center.xml b/java/res/xml-v16/key_devanagari_sign_anusvara.xml
similarity index 85%
rename from java/res/xml-v16/key_nepali_romanized3_shift_center.xml
rename to java/res/xml-v16/key_devanagari_sign_anusvara.xml
index 5b27b66d955f48f86c2f71e62400b3da6b18dd48..27c7bff5acdfafb3f2ed47d165c00122db1ee150 100644
--- a/java/res/xml-v16/key_nepali_romanized3_shift_center.xml
+++ b/java/res/xml-v16/key_devanagari_sign_anusvara.xml
@@ -20,8 +20,8 @@
 
 <!-- The code point U+25CC for key label is needed because the font rendering system prior to
      API version 16 can't automatically render dotted circle for incomplete combining letter
-     of Hindi. The files named res/xml/{key,keys}_nepali*.xml have this U+25CC hack, although the
-     counterpart files named res/xml-v16/{key,keys}_nepali*.xml don't have this hack. -->
+     of some scripts. The files named res/xml/key_*.xml have this U+25CC hack, although the
+     counterpart files named res/xml-v16/key_*.xml don't have this hack. -->
 <merge
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
 >
diff --git a/java/res/xml-v16/key_nepali_romanized3_shift_left.xml b/java/res/xml-v16/key_devanagari_sign_candrabindu.xml
similarity index 59%
rename from java/res/xml-v16/key_nepali_romanized3_shift_left.xml
rename to java/res/xml-v16/key_devanagari_sign_candrabindu.xml
index 5d153702b69ec2ff4481145e6ed410406637dba8..03017dd7832f4762aac6fd9834b607e699593cee 100644
--- a/java/res/xml-v16/key_nepali_romanized3_shift_left.xml
+++ b/java/res/xml-v16/key_devanagari_sign_candrabindu.xml
@@ -20,13 +20,29 @@
 
 <!-- The code point U+25CC for key label is needed because the font rendering system prior to
      API version 16 can't automatically render dotted circle for incomplete combining letter
-     of Hindi. The files named res/xml/{key,keys}_nepali*.xml have this U+25CC hack, although the
-     counterpart files named res/xml-v16/{key,keys}_nepali*.xml don't have this hack. -->
+     of some scripts. The files named res/xml/key_*.xml have this U+25CC hack, although the
+     counterpart files named res/xml-v16/key_*.xml don't have this hack. -->
 <merge
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
 >
+    <switch>
+        <case
+            latin:keyboardLayoutSet="hindi"
+        >
+            <!-- U+0901: "ँ" DEVANAGARI SIGN CANDRABINDU
+                 U+0945: "ॅ" DEVANAGARI VOWEL SIGN CANDRA E -->
+            <key-style
+                latin:styleName="moreKeysDevanagariSignCandrabindu"
+                latin:moreKeys="&#x0945;" />
+        </case>
+        <default>
+             <key-style
+                latin:styleName="moreKeysDevanagariSignCandrabindu" />
+        </default>
+    </switch>
     <!-- U+0901: "ँ" DEVANAGARI SIGN CANDRABINDU -->
     <Key
+        latin:keyStyle="moreKeysDevanagariSignCandrabindu"
         latin:keyLabel="&#x0901;"
         latin:keyLabelFlags="fontNormal" />
 </merge>
diff --git a/java/res/xml-v16/key_hindi3_right.xml b/java/res/xml-v16/key_devanagari_sign_nukta.xml
similarity index 55%
rename from java/res/xml-v16/key_hindi3_right.xml
rename to java/res/xml-v16/key_devanagari_sign_nukta.xml
index 232810f986241fb00bf10deb4e6d94495587302d..09c347706f9cefe9681db822a97676f75ed97c6f 100644
--- a/java/res/xml-v16/key_hindi3_right.xml
+++ b/java/res/xml-v16/key_devanagari_sign_nukta.xml
@@ -20,17 +20,30 @@
 
 <!-- The code point U+25CC for key label is needed because the font rendering system prior to
      API version 16 can't automatically render dotted circle for incomplete combining letter
-     of Hindi. The files named res/xml/{key,keys}_hindi*.xml have this U+25CC hack, although the
-     counterpart files named res/xml-v16/{key,keys}_hindi*.xml don't have this hack. -->
+     of some scripts. The files named res/xml/key_*.xml have this U+25CC hack, although the
+     counterpart files named res/xml-v16/key_*.xml don't have this hack. -->
 <merge
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
 >
-    <!-- U+093C: "़" DEVANAGARI SIGN NUKTA
-         U+097D: "ॽ" DEVANAGARI LETTER GLOTTAL STOP
-         U+0970: "॰" DEVANAGARI ABBREVIATION SIGN
-         U+093D: "ऽ" DEVANAGARI SIGN AVAGRAHA -->
+    <switch>
+        <case
+            latin:keyboardLayoutSet="hindi"
+        >
+            <!-- U+097D: "ॽ" DEVANAGARI LETTER GLOTTAL STOP
+                 U+0970: "॰" DEVANAGARI ABBREVIATION SIGN
+                 U+093D: "ऽ" DEVANAGARI SIGN AVAGRAHA -->
+             <key-style
+                latin:styleName="moreKeysDevanagariSignNukta"
+                latin:moreKeys="&#x097D;,&#x0970;,&#x093D;" />
+        </case>
+        <default>
+             <key-style
+                latin:styleName="moreKeysDevanagariSignNukta" />
+        </default>
+    </switch>
+    <!-- U+093C: "़" DEVANAGARI SIGN NUKTA -->
     <Key
+        latin:keyStyle="moreKeysDevanagariSignNukta"
         latin:keyLabel="&#x093C;"
-        latin:moreKeys="&#x097D;,&#x0970;,&#x093D;"
         latin:keyLabelFlags="fontNormal" />
 </merge>
diff --git a/java/res/xml-v16/key_nepali_romanized3_shift_right.xml b/java/res/xml-v16/key_devanagari_sign_virama.xml
similarity index 85%
rename from java/res/xml-v16/key_nepali_romanized3_shift_right.xml
rename to java/res/xml-v16/key_devanagari_sign_virama.xml
index 4dad7bdad0e204db6cf50478ff58d12ef45db2a9..579323af3fe001e186fe6110b3619b55ce387fbd 100644
--- a/java/res/xml-v16/key_nepali_romanized3_shift_right.xml
+++ b/java/res/xml-v16/key_devanagari_sign_virama.xml
@@ -20,8 +20,8 @@
 
 <!-- The code point U+25CC for key label is needed because the font rendering system prior to
      API version 16 can't automatically render dotted circle for incomplete combining letter
-     of Hindi. The files named res/xml/{key,keys}_nepali*.xml have this U+25CC hack, although the
-     counterpart files named res/xml-v16/{key,keys}_nepali*.xml don't have this hack. -->
+     of some scripts. The files named res/xml/key_*.xml have this U+25CC hack, although the
+     counterpart files named res/xml-v16/key_*.xml don't have this hack. -->
 <merge
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
 >
diff --git a/java/res/xml-v16/key_hindi1_shift.xml b/java/res/xml-v16/key_devanagari_sign_visarga.xml
similarity index 85%
rename from java/res/xml-v16/key_hindi1_shift.xml
rename to java/res/xml-v16/key_devanagari_sign_visarga.xml
index 19b964367e15b6647e7f7f41bdba209174afc67c..c457ac7f0351d1886cd6206a871692d4d5452669 100644
--- a/java/res/xml-v16/key_hindi1_shift.xml
+++ b/java/res/xml-v16/key_devanagari_sign_visarga.xml
@@ -20,8 +20,8 @@
 
 <!-- The code point U+25CC for key label is needed because the font rendering system prior to
      API version 16 can't automatically render dotted circle for incomplete combining letter
-     of Hindi. The files named res/xml/{key,keys}_hindi*.xml have this U+25CC hack, although the
-     counterpart files named res/xml-v16/{key,keys}_hindi*.xml don't have this hack. -->
+     of some scripts. The files named res/xml/key_*.xml have this U+25CC hack, although the
+     counterpart files named res/xml-v16/key_*.xml don't have this hack. -->
 <merge
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
 >
diff --git a/java/res/xml-v16/key_nepali_romanized3.xml b/java/res/xml-v16/key_devanagari_vowel_sign_candra_o.xml
similarity index 78%
rename from java/res/xml-v16/key_nepali_romanized3.xml
rename to java/res/xml-v16/key_devanagari_vowel_sign_candra_o.xml
index 4dad7bdad0e204db6cf50478ff58d12ef45db2a9..0316a7bde51ceec399d0a98f1ab7b3412ecb217e 100644
--- a/java/res/xml-v16/key_nepali_romanized3.xml
+++ b/java/res/xml-v16/key_devanagari_vowel_sign_candra_o.xml
@@ -20,13 +20,13 @@
 
 <!-- The code point U+25CC for key label is needed because the font rendering system prior to
      API version 16 can't automatically render dotted circle for incomplete combining letter
-     of Hindi. The files named res/xml/{key,keys}_nepali*.xml have this U+25CC hack, although the
-     counterpart files named res/xml-v16/{key,keys}_nepali*.xml don't have this hack. -->
+     of some scripts. The files named res/xml/key_*.xml have this U+25CC hack, although the
+     counterpart files named res/xml-v16/key_*.xml don't have this hack. -->
 <merge
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
 >
-    <!-- U+094D: "्" DEVANAGARI SIGN VIRAMA -->
+    <!-- U+0949: "ॉ" DEVANAGARI VOWEL SIGN CANDRA O -->
     <Key
-        latin:keyLabel="&#x094D;"
+        latin:keyLabel="&#x0949;"
         latin:keyLabelFlags="fontNormal" />
 </merge>
diff --git a/java/res/xml-v16/keys_nepali_romanized1_shift_left2.xml b/java/res/xml-v16/key_devanagari_vowel_sign_vocalic_r.xml
similarity index 61%
rename from java/res/xml-v16/keys_nepali_romanized1_shift_left2.xml
rename to java/res/xml-v16/key_devanagari_vowel_sign_vocalic_r.xml
index a3d97e7dfd6d10d68d419c6b3876bb57dab28b10..e6e771de2160040382815702bbb21f3ae2e2ce6e 100644
--- a/java/res/xml-v16/keys_nepali_romanized1_shift_left2.xml
+++ b/java/res/xml-v16/key_devanagari_vowel_sign_vocalic_r.xml
@@ -20,17 +20,28 @@
 
 <!-- The code point U+25CC for key label is needed because the font rendering system prior to
      API version 16 can't automatically render dotted circle for incomplete combining letter
-     of Hindi. The files named res/xml/{key,keys}_nepali*.xml have this U+25CC hack, although the
-     counterpart files named res/xml-v16/{key,keys}_nepali*.xml don't have this hack. -->
+     of some scripts. The files named res/xml/key_*.xml have this U+25CC hack, although the
+     counterpart files named res/xml-v16/key_*.xml don't have this hack. -->
 <merge
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
 >
-    <!-- U+0948: "ै" DEVANAGARI VOWEL SIGN AI -->
-    <Key
-        latin:keyLabel="&#x0948;"
-        latin:keyLabelFlags="fontNormal" />
+    <switch>
+        <case
+            latin:keyboardLayoutSet="hindi"
+        >
+            <!-- U+0944: "ॄ" DEVANAGARI VOWEL SIGN VOCALIC RR -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignVocalicR"
+                latin:moreKeys="&#x0944;" />
+        </case>
+        <default>
+             <key-style
+                latin:styleName="moreKeysDevanagariVowelSignVocalicR" />
+        </default>
+    </switch>
     <!-- U+0943: "ृ" DEVANAGARI VOWEL SIGN VOCALIC R -->
     <Key
+        latin:keyStyle="moreKeysDevanagariVowelSignVocalicR"
         latin:keyLabel="&#x0943;"
         latin:keyLabelFlags="fontNormal" />
 </merge>
diff --git a/java/res/xml-v16/key_nepali_romanized2_shift.xml b/java/res/xml-v16/key_nepali_romanized2_shift.xml
deleted file mode 100644
index 0257b5f88b8f50c49ba58202834e461b820be75e..0000000000000000000000000000000000000000
--- a/java/res/xml-v16/key_nepali_romanized2_shift.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-**
-** Copyright 2013, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<!-- The code point U+25CC for key label is needed because the font rendering system prior to
-     API version 16 can't automatically render dotted circle for incomplete combining letter
-     of Hindi. The files named res/xml/{key,keys}_nepali*.xml have this U+25CC hack, although the
-     counterpart files named res/xml-v16/{key,keys}_nepali*.xml don't have this hack. -->
-<merge
-    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
->
-    <!-- U+0903: "ः" DEVANAGARI SIGN VISARGA -->
-    <Key
-        latin:keyLabel="&#x0903;"
-        latin:keyLabelFlags="fontNormal" />
-</merge>
diff --git a/java/res/xml-v16/keys_hindi1_left5.xml b/java/res/xml-v16/keys_hindi1_left5.xml
deleted file mode 100644
index e3ad299ff394417509e15c5a22660b2b0a3a3359..0000000000000000000000000000000000000000
--- a/java/res/xml-v16/keys_hindi1_left5.xml
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-**
-** Copyright 2013, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<!-- The code point U+25CC for key label is needed because the font rendering system prior to
-     API version 16 can't automatically render dotted circle for incomplete combining letter
-     of Hindi. The files named res/xml/{key,keys}_hindi*.xml have this U+25CC hack, although the
-     counterpart files named res/xml-v16/{key,keys}_hindi*.xml don't have this hack. -->
-<merge
-    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
->
-    <!-- U+094C: "ौ" DEVANAGARI VOWEL SIGN AU
-         U+094C/U+0902: "ौं" DEVANAGARI VOWEL SIGN AU/DEVANAGARI SIGN ANUSVARA
-         U+0967: "१" DEVANAGARI DIGIT ONE -->
-    <Key
-        latin:keyLabel="&#x094C;"
-        latin:moreKeys="&#x094C;&#x0902;,%"
-        latin:keyHintLabel="1"
-        latin:additionalMoreKeys="&#x0967;,1"
-        latin:keyLabelFlags="fontNormal" />
-    <!-- U+0948: "ै" DEVANAGARI VOWEL SIGN AI
-         U+0948/U+0902: "ैं" DEVANAGARI VOWEL SIGN AI/DEVANAGARI SIGN ANUSVARA
-         U+0968: "२" DEVANAGARI DIGIT TWO -->
-    <Key
-        latin:keyLabel="&#x0948;"
-        latin:moreKeys="&#x0948;&#x0902;,%"
-        latin:keyHintLabel="2"
-        latin:additionalMoreKeys="&#x0968;,2"
-        latin:keyLabelFlags="fontNormal" />
-    <!-- U+093E: "ा" DEVANAGARI VOWEL SIGN AA
-         U+093E/U+0902: "ां" DEVANAGARI VOWEL SIGN AA/DEVANAGARI SIGN ANUSVARA
-         U+093E/U+0901: "ाँ" DEVANAGARI VOWEL SIGN AA/DEVANAGARI SIGN CANDRABINDU
-         U+0969: "३" DEVANAGARI DIGIT THREE -->
-    <Key
-        latin:keyLabel="&#x093E;"
-        latin:moreKeys="&#x093E;&#x0902;,&#x093E;&#x0901;,%"
-        latin:keyHintLabel="3"
-        latin:additionalMoreKeys="&#x0969;,3"
-        latin:keyLabelFlags="fontNormal" />
-    <!-- U+0940: "ी" DEVANAGARI VOWEL SIGN II
-         U+0940/U+0902: "ीं" DEVANAGARI VOWEL SIGN II/DEVANAGARI SIGN ANUSVARA
-         U+096A: "४" DEVANAGARI DIGIT FOUR -->
-    <Key
-        latin:keyLabel="&#x0940;"
-        latin:moreKeys="&#x0940;&#x0902;,%"
-        latin:keyHintLabel="4"
-        latin:additionalMoreKeys="&#x096A;,4"
-        latin:keyLabelFlags="fontNormal" />
-    <!-- U+0942: "ू" DEVANAGARI VOWEL SIGN UU
-         U+0942/U+0902: "ूं" DEVANAGARI VOWEL SIGN UU/DEVANAGARI SIGN ANUSVARA
-         U+0942/U+0901: "ूँ" DEVANAGARI VOWEL SIGN UU/DEVANAGARI SIGN CANDRABINDU
-         U+096B: "५" DEVANAGARI DIGIT FIVE -->
-    <Key
-        latin:keyLabel="&#x0942;"
-        latin:moreKeys="&#x0942;&#x0902;,&#x0942;&#x0901;,%"
-        latin:keyHintLabel="5"
-        latin:additionalMoreKeys="&#x096B;,5"
-        latin:keyLabelFlags="fontNormal" />
-</merge>
diff --git a/java/res/xml-v16/keys_hindi2_left5.xml b/java/res/xml-v16/keys_hindi2_left5.xml
deleted file mode 100644
index 05c4f57e9ff8122b88f7e85e0f30cbaf77a7cff9..0000000000000000000000000000000000000000
--- a/java/res/xml-v16/keys_hindi2_left5.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-**
-** Copyright 2013, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<!-- The code point U+25CC for key label is needed because the font rendering system prior to
-     API version 16 can't automatically render dotted circle for incomplete combining letter
-     of Hindi. The files named res/xml/{key,keys}_hindi*.xml have this U+25CC hack, although the
-     counterpart files named res/xml-v16/{key,keys}_hindi*.xml don't have this hack. -->
-<merge
-    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
->
-    <!-- U+094B: "ो" DEVANAGARI VOWEL SIGN O
-         U+094B/U+0902: "қं" DEVANAGARI VOWEL SIGN O/DEVANAGARI SIGN ANUSVARA
-         U+0949: "ॉ" DEVANAGARI VOWEL SIGN CANDRA O
-         U+094A: "ॊ" DEVANAGARI VOWEL SIGN SHORT O -->
-    <Key
-        latin:keyLabel="&#x094B;"
-        latin:moreKeys="&#x094B;&#x0902;,&#x0949;,&#x094A;"
-        latin:keyLabelFlags="fontNormal" />
-    <!-- U+0947: "े" DEVANAGARI VOWEL SIGN E
-         U+0947/U+0902: "ें" DEVANAGARI VOWEL SIGN E/DEVANAGARI SIGN ANUSVARA -->
-    <Key
-        latin:keyLabel="&#x0947;"
-        latin:moreKeys="&#x0947;&#x0902;"
-        latin:keyLabelFlags="fontNormal" />
-    <!-- U+094D: "्" DEVANAGARI SIGN VIRAMA -->
-    <Key
-        latin:keyLabel="&#x094D;"
-        latin:keyLabelFlags="fontNormal" />
-    <!-- U+093F: "ि" DEVANAGARI VOWEL SIGN I
-         U+093F/U+0902: "िं" DEVANAGARI VOWEL SIGN I/DEVANAGARI SIGN ANUSVARA -->
-    <Key
-        latin:keyLabel="&#x093F;"
-        latin:moreKeys="&#x093F;&#x0902;"
-        latin:keyLabelFlags="fontNormal" />
-    <!-- U+0941: "ु" DEVANAGARI VOWEL SIGN U
-         U+0941/U+0902: "ुं" DEVANAGARI VOWEL SIGN U/DEVANAGARI SIGN ANUSVARA
-         U+0941/U+0901: "ुँ" DEVANAGARI VOWEL SIGN U/DEVANAGARI SIGN CANDRABINDU -->
-    <Key
-        latin:keyLabel="&#x0941;"
-        latin:moreKeys="&#x0941;&#x0902;,&#x0941;&#x0901;"
-        latin:keyLabelFlags="fontNormal" />
-</merge>
diff --git a/java/res/xml-v16/keys_hindi3_left2.xml b/java/res/xml-v16/keys_hindi3_left2.xml
deleted file mode 100644
index 9474c17638340b4bbad432d191613e62d9e76f35..0000000000000000000000000000000000000000
--- a/java/res/xml-v16/keys_hindi3_left2.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-**
-** Copyright 2013, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<!-- The code point U+25CC for key label is needed because the font rendering system prior to
-     API version 16 can't automatically render dotted circle for incomplete combining letter
-     of Hindi. The files named res/xml/{key,keys}_hindi*.xml have this U+25CC hack, although the
-     counterpart files named res/xml-v16/{key,keys}_hindi*.xml don't have this hack. -->
-<merge
-    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
->
-    <!-- U+0949: "ॉ" DEVANAGARI VOWEL SIGN CANDRA O -->
-    <Key
-        latin:keyLabel="&#x0949;"
-        latin:keyLabelFlags="fontNormal" />
-    <!-- U+0902: "ं" DEVANAGARI SIGN ANUSVARA -->
-    <Key
-        latin:keyLabel="&#x0902;"
-        latin:keyLabelFlags="fontNormal" />
-</merge>
diff --git a/java/res/xml-v16/key_nepali_romanized2.xml b/java/res/xml-v16/keystyle_devanagari_vowel_sign_aa.xml
similarity index 55%
rename from java/res/xml-v16/key_nepali_romanized2.xml
rename to java/res/xml-v16/keystyle_devanagari_vowel_sign_aa.xml
index 88450989af6b5c6303092e074197c1d7b864b9c0..8e256032c0d538c00fcd5a035b2037d3d42c4707 100644
--- a/java/res/xml-v16/key_nepali_romanized2.xml
+++ b/java/res/xml-v16/keystyle_devanagari_vowel_sign_aa.xml
@@ -20,13 +20,30 @@
 
 <!-- The code point U+25CC for key label is needed because the font rendering system prior to
      API version 16 can't automatically render dotted circle for incomplete combining letter
-     of Hindi. The files named res/xml/{key,keys}_nepali*.xml have this U+25CC hack, although the
-     counterpart files named res/xml-v16/{key,keys}_nepali*.xml don't have this hack. -->
+     of some scripts. The files named res/xml/key_*.xml have this U+25CC hack, although the
+     counterpart files named res/xml-v16/key_*.xml don't have this hack. -->
 <merge
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
 >
+    <switch>
+        <case
+            latin:keyboardLayoutSet="hindi"
+        >
+            <!-- U+093E/U+0902: "ां" DEVANAGARI VOWEL SIGN AA/DEVANAGARI SIGN ANUSVARA
+                 U+093E/U+0901: "ाँ" DEVANAGARI VOWEL SIGN AA/DEVANAGARI SIGN CANDRABINDU -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignAa"
+                latin:moreKeys="&#x093E;&#x0902;,&#x093E;&#x0901;,%" />
+        </case>
+        <default>
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignAa" />
+        </default>
+    </switch>
     <!-- U+093E: "ा" DEVANAGARI VOWEL SIGN AA -->
-    <Key
+    <key-style
+        latin:styleName="baseKeyDevanagariVowelSignAa"
+        latin:parentStyle="moreKeysDevanagariVowelSignAa"
         latin:keyLabel="&#x093E;"
         latin:keyLabelFlags="fontNormal" />
 </merge>
diff --git a/java/res/xml-v16/key_hindi3_shift_right.xml b/java/res/xml-v16/keystyle_devanagari_vowel_sign_ai.xml
similarity index 53%
rename from java/res/xml-v16/key_hindi3_shift_right.xml
rename to java/res/xml-v16/keystyle_devanagari_vowel_sign_ai.xml
index 0f26cb55ccd6048b74960631e04f5df58bef50ad..fc6e637cf07b31b485ee84c77b819c11d6e57890 100644
--- a/java/res/xml-v16/key_hindi3_shift_right.xml
+++ b/java/res/xml-v16/keystyle_devanagari_vowel_sign_ai.xml
@@ -20,15 +20,29 @@
 
 <!-- The code point U+25CC for key label is needed because the font rendering system prior to
      API version 16 can't automatically render dotted circle for incomplete combining letter
-     of Hindi. The files named res/xml/{key,keys}_hindi*.xml have this U+25CC hack, although the
-     counterpart files named res/xml-v16/{key,keys}_hindi*.xml don't have this hack. -->
+     of some scripts. The files named res/xml/key_*.xml have this U+25CC hack, although the
+     counterpart files named res/xml-v16/key_*.xml don't have this hack. -->
 <merge
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
 >
-    <!-- U+0943: "ृ" DEVANAGARI VOWEL SIGN VOCALIC R
-         U+0944: "ॄ" DEVANAGARI VOWEL SIGN VOCALIC RR -->
-    <Key
-        latin:keyLabel="&#x0943;"
-        latin:moreKeys="&#x0944;"
+    <switch>
+        <case
+            latin:keyboardLayoutSet="hindi"
+        >
+            <!-- U+0948/U+0902: "ैं" DEVANAGARI VOWEL SIGN AI/DEVANAGARI SIGN ANUSVARA -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignAi"
+                latin:moreKeys="&#x0948;&#x0902;,%" />
+        </case>
+        <default>
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignAi" />
+        </default>
+    </switch>
+    <!-- U+0948: "ै" DEVANAGARI VOWEL SIGN AI -->
+    <key-style
+        latin:styleName="baseKeyDevanagariVowelSignAi"
+        latin:parentStyle="moreKeysDevanagariVowelSignAi"
+        latin:keyLabel="&#x0948;"
         latin:keyLabelFlags="fontNormal" />
 </merge>
diff --git a/java/res/xml-v16/keystyle_devanagari_vowel_sign_au.xml b/java/res/xml-v16/keystyle_devanagari_vowel_sign_au.xml
new file mode 100644
index 0000000000000000000000000000000000000000..43387a388c2ae9c7daf140c5b376abe17a24cb25
--- /dev/null
+++ b/java/res/xml-v16/keystyle_devanagari_vowel_sign_au.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2013, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<!-- The code point U+25CC for key label is needed because the font rendering system prior to
+     API version 16 can't automatically render dotted circle for incomplete combining letter
+     of some scripts. The files named res/xml/key_*.xml have this U+25CC hack, although the
+     counterpart files named res/xml-v16/key_*.xml don't have this hack. -->
+<merge
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+    <switch>
+        <case
+            latin:keyboardLayoutSet="hindi"
+        >
+            <!--U+094C/U+0902: "ौं" DEVANAGARI VOWEL SIGN AU/DEVANAGARI SIGN ANUSVARA -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignAu"
+                latin:moreKeys="&#x094C;&#x0902;,%" />
+        </case>
+        <default>
+             <key-style
+                latin:styleName="moreKeysDevanagariVowelSignAu" />
+        </default>
+    </switch>
+    <!-- U+094C: "ौ" DEVANAGARI VOWEL SIGN AU -->
+    <key-style
+        latin:styleName="baseKeyDevanagariVowelSignAu"
+        latin:parentStyle="moreKeysDevanagariVowelSignAu"
+        latin:keyLabel="&#x094C;"
+        latin:keyLabelFlags="fontNormal" />
+</merge>
diff --git a/java/res/xml-v16/keys_nepali_romanized1_left2.xml b/java/res/xml-v16/keystyle_devanagari_vowel_sign_e.xml
similarity index 55%
rename from java/res/xml-v16/keys_nepali_romanized1_left2.xml
rename to java/res/xml-v16/keystyle_devanagari_vowel_sign_e.xml
index d84524afcf88a126af606fd0957bb691c8b7ae91..6a7fb2952e1789a35a5e4eab3157b38d1fd1a02c 100644
--- a/java/res/xml-v16/keys_nepali_romanized1_left2.xml
+++ b/java/res/xml-v16/keystyle_devanagari_vowel_sign_e.xml
@@ -20,23 +20,29 @@
 
 <!-- The code point U+25CC for key label is needed because the font rendering system prior to
      API version 16 can't automatically render dotted circle for incomplete combining letter
-     of Hindi. The files named res/xml/{key,keys}_nepali*.xml have this U+25CC hack, although the
-     counterpart files named res/xml-v16/{key,keys}_nepali*.xml don't have this hack. -->
+     of some scripts. The files named res/xml/key_*.xml have this U+25CC hack, although the
+     counterpart files named res/xml-v16/key_*.xml don't have this hack. -->
 <merge
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
 >
-    <!-- U+094C: "ौ" DEVANAGARI VOWEL SIGN AU
-         U+0968: "२" DEVANAGARI DIGIT TWO -->
-    <Key
-        latin:keyLabel="&#x094C;"
-        latin:keyHintLabel="2"
-        latin:additionalMoreKeys="&#x0968;,2"
-        latin:keyLabelFlags="fontNormal" />
-    <!-- U+0947: "े" DEVANAGARI VOWEL SIGN E
-         U+0969: "३" DEVANAGARI DIGIT THREE -->
-    <Key
+    <switch>
+        <case
+            latin:keyboardLayoutSet="hindi"
+        >
+            <!-- U+0947/U+0902: "ें" DEVANAGARI VOWEL SIGN E/DEVANAGARI SIGN ANUSVARA -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignE"
+                latin:moreKeys="&#x0947;&#x0902;" />
+        </case>
+        <default>
+             <key-style
+                latin:styleName="moreKeysDevanagariVowelSignE" />
+        </default>
+    </switch>
+    <!-- U+0947: "े" DEVANAGARI VOWEL SIGN E -->
+    <key-style
+        latin:styleName="baseKeyDevanagariVowelSignE"
+        latin:parentStyle="moreKeysDevanagariVowelSignE"
         latin:keyLabel="&#x0947;"
-        latin:keyHintLabel="3"
-        latin:additionalMoreKeys="&#x0969;,3"
         latin:keyLabelFlags="fontNormal" />
 </merge>
diff --git a/java/res/xml-v16/key_hindi3_shift_left.xml b/java/res/xml-v16/keystyle_devanagari_vowel_sign_i.xml
similarity index 54%
rename from java/res/xml-v16/key_hindi3_shift_left.xml
rename to java/res/xml-v16/keystyle_devanagari_vowel_sign_i.xml
index 1eb1768a1a971bccbc0c79fb8ac33c20393684bd..845c1b02ed33975d9e9a166c154bde4fc68c2817 100644
--- a/java/res/xml-v16/key_hindi3_shift_left.xml
+++ b/java/res/xml-v16/keystyle_devanagari_vowel_sign_i.xml
@@ -20,15 +20,29 @@
 
 <!-- The code point U+25CC for key label is needed because the font rendering system prior to
      API version 16 can't automatically render dotted circle for incomplete combining letter
-     of Hindi. The files named res/xml/{key,keys}_hindi*.xml have this U+25CC hack, although the
-     counterpart files named res/xml-v16/{key,keys}_hindi*.xml don't have this hack. -->
+     of some scripts. The files named res/xml/key_*.xml have this U+25CC hack, although the
+     counterpart files named res/xml-v16/key_*.xml don't have this hack. -->
 <merge
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
 >
-    <!-- U+0901: "ँ" DEVANAGARI SIGN CANDRABINDU
-         U+0945: "ॅ" DEVANAGARI VOWEL SIGN CANDRA E -->
-    <Key
-        latin:keyLabel="&#x0901;"
-        latin:moreKeys="&#x0945;"
+    <switch>
+        <case
+            latin:keyboardLayoutSet="hindi"
+        >
+            <!-- U+093F/U+0902: "िं" DEVANAGARI VOWEL SIGN I/DEVANAGARI SIGN ANUSVARA -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignI"
+                latin:moreKeys="&#x093F;&#x0902;" />
+        </case>
+        <default>
+             <key-style
+                latin:styleName="moreKeysDevanagariVowelSignI" />
+        </default>
+    </switch>
+    <!-- U+093F: "ि" DEVANAGARI VOWEL SIGN I -->
+    <key-style
+        latin:styleName="baseKeyDevanagariVowelSignI"
+        latin:parentStyle="moreKeysDevanagariVowelSignI"
+        latin:keyLabel="&#x093F;"
         latin:keyLabelFlags="fontNormal" />
 </merge>
diff --git a/java/res/xml-v16/keys_nepali_romanized1_shift_right2.xml b/java/res/xml-v16/keystyle_devanagari_vowel_sign_ii.xml
similarity index 58%
rename from java/res/xml-v16/keys_nepali_romanized1_shift_right2.xml
rename to java/res/xml-v16/keystyle_devanagari_vowel_sign_ii.xml
index 6ec97350c89a6e8639d986505bcbcc50b0a1ef9a..0de9650be09eba8e5d36bf6802ad9de1b6af8c14 100644
--- a/java/res/xml-v16/keys_nepali_romanized1_shift_right2.xml
+++ b/java/res/xml-v16/keystyle_devanagari_vowel_sign_ii.xml
@@ -20,17 +20,29 @@
 
 <!-- The code point U+25CC for key label is needed because the font rendering system prior to
      API version 16 can't automatically render dotted circle for incomplete combining letter
-     of Hindi. The files named res/xml/{key,keys}_nepali*.xml have this U+25CC hack, although the
-     counterpart files named res/xml-v16/{key,keys}_nepali*.xml don't have this hack. -->
+     of some scripts. The files named res/xml/key_*.xml have this U+25CC hack, although the
+     counterpart files named res/xml-v16/key_*.xml don't have this hack. -->
 <merge
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
 >
-    <!-- U+0942: "ू" DEVANAGARI VOWEL SIGN UU -->
-    <Key
-        latin:keyLabel="&#x0942;"
-        latin:keyLabelFlags="fontNormal" />
+    <switch>
+        <case
+            latin:keyboardLayoutSet="hindi"
+        >
+            <!-- U+0940/U+0902: "ीं" DEVANAGARI VOWEL SIGN II/DEVANAGARI SIGN ANUSVARA -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignIi"
+                latin:moreKeys="&#x0940;&#x0902;,%" />
+        </case>
+        <default>
+             <key-style
+                latin:styleName="moreKeysDevanagariVowelSignIi" />
+        </default>
+    </switch>
     <!-- U+0940: "ी" DEVANAGARI VOWEL SIGN II -->
-    <Key
+    <key-style
+        latin:styleName="baseKeyDevanagariVowelSignIi"
+        latin:parentStyle="moreKeysDevanagariVowelSignIi"
         latin:keyLabel="&#x0940;"
         latin:keyLabelFlags="fontNormal" />
 </merge>
diff --git a/java/res/xml-v16/keystyle_devanagari_vowel_sign_o.xml b/java/res/xml-v16/keystyle_devanagari_vowel_sign_o.xml
new file mode 100644
index 0000000000000000000000000000000000000000..06f07fac9641a7737026afda612a51afad74e8d8
--- /dev/null
+++ b/java/res/xml-v16/keystyle_devanagari_vowel_sign_o.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2013, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<!-- The code point U+25CC for key label is needed because the font rendering system prior to
+     API version 16 can't automatically render dotted circle for incomplete combining letter
+     of some scripts. The files named res/xml/key_*.xml have this U+25CC hack, although the
+     counterpart files named res/xml-v16/key_*.xml don't have this hack. -->
+<merge
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+    <switch>
+        <case
+            latin:keyboardLayoutSet="hindi"
+        >
+            <!-- U+094B/U+0902: "қं" DEVANAGARI VOWEL SIGN O/DEVANAGARI SIGN ANUSVARA
+                 U+0949: "ॉ" DEVANAGARI VOWEL SIGN CANDRA O
+                 U+094A: "ॊ" DEVANAGARI VOWEL SIGN SHORT O -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignO"
+                latin:moreKeys="&#x094B;&#x0902;,&#x0949;,&#x094A;" />
+        </case>
+        <default>
+             <key-style
+                latin:styleName="moreKeysDevanagariVowelSignO" />
+        </default>
+    </switch>
+    <!-- U+094B: "ो" DEVANAGARI VOWEL SIGN O -->
+    <key-style
+        latin:styleName="baseKeyDevanagariVowelSignO"
+        latin:parentStyle="moreKeysDevanagariVowelSignO"
+        latin:keyLabel="&#x094B;"
+        latin:keyLabelFlags="fontNormal" />
+</merge>
diff --git a/java/res/xml-v16/keys_nepali_romanized1_right3.xml b/java/res/xml-v16/keystyle_devanagari_vowel_sign_u.xml
similarity index 52%
rename from java/res/xml-v16/keys_nepali_romanized1_right3.xml
rename to java/res/xml-v16/keystyle_devanagari_vowel_sign_u.xml
index 0105f13ffc22161ffe8eeabc0178335ad407474b..469a27bdf4d3d89fc1a0e5623078fbc7d9d4ef85 100644
--- a/java/res/xml-v16/keys_nepali_romanized1_right3.xml
+++ b/java/res/xml-v16/keystyle_devanagari_vowel_sign_u.xml
@@ -20,30 +20,30 @@
 
 <!-- The code point U+25CC for key label is needed because the font rendering system prior to
      API version 16 can't automatically render dotted circle for incomplete combining letter
-     of Hindi. The files named res/xml/{key,keys}_nepali*.xml have this U+25CC hack, although the
-     counterpart files named res/xml-v16/{key,keys}_nepali*.xml don't have this hack. -->
+     of some scripts. The files named res/xml/key_*.xml have this U+25CC hack, although the
+     counterpart files named res/xml-v16/key_*.xml don't have this hack. -->
 <merge
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
 >
-    <!-- U+0941: "ु" DEVANAGARI VOWEL SIGN U
-         U+096D: "७" DEVANAGARI DIGIT SEVEN -->
-    <Key
+    <switch>
+        <case
+            latin:keyboardLayoutSet="hindi"
+        >
+            <!-- U+0941/U+0902: "ुं" DEVANAGARI VOWEL SIGN U/DEVANAGARI SIGN ANUSVARA
+                 U+0941/U+0901: "ुँ" DEVANAGARI VOWEL SIGN U/DEVANAGARI SIGN CANDRABINDU -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignU"
+                latin:moreKeys="&#x0941;&#x0902;,&#x0941;&#x0901;" />
+        </case>
+        <default>
+             <key-style
+                latin:styleName="moreKeysDevanagariVowelSignU" />
+        </default>
+    </switch>
+    <!-- U+0941: "ु" DEVANAGARI VOWEL SIGN U -->
+    <key-style
+        latin:styleName="baseKeyDevanagariVowelSignU"
+        latin:parentStyle="moreKeysDevanagariVowelSignU"
         latin:keyLabel="&#x0941;"
-        latin:keyHintLabel="7"
-        latin:additionalMoreKeys="&#x096D;,7"
-        latin:keyLabelFlags="fontNormal" />
-    <!-- U+093F: "ि" DEVANAGARI VOWEL SIGN I
-         U+096E: "८" DEVANAGARI DIGIT EIGHT -->
-    <Key
-        latin:keyLabel="&#x093F;"
-        latin:keyHintLabel="8"
-        latin:additionalMoreKeys="&#x096E;,8"
-        latin:keyLabelFlags="fontNormal" />
-    <!-- U+094B: "ो" DEVANAGARI VOWEL SIGN O
-         U+096F: "९" DEVANAGARI DIGIT NINE -->
-    <Key
-        latin:keyLabel="&#x094B;"
-        latin:keyHintLabel="9"
-        latin:additionalMoreKeys="&#x096F;,9"
         latin:keyLabelFlags="fontNormal" />
 </merge>
diff --git a/java/res/xml-v16/keystyle_devanagari_vowel_sign_uu.xml b/java/res/xml-v16/keystyle_devanagari_vowel_sign_uu.xml
new file mode 100644
index 0000000000000000000000000000000000000000..25867c0860ba5054d5d139f996b820eae05daa0e
--- /dev/null
+++ b/java/res/xml-v16/keystyle_devanagari_vowel_sign_uu.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2013, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<!-- The code point U+25CC for key label is needed because the font rendering system prior to
+     API version 16 can't automatically render dotted circle for incomplete combining letter
+     of some scripts. The files named res/xml/key_*.xml have this U+25CC hack, although the
+     counterpart files named res/xml-v16/key_*.xml don't have this hack. -->
+<merge
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+    <switch>
+        <case
+            latin:keyboardLayoutSet="hindi"
+        >
+            <!-- U+0942/U+0902: "ूं" DEVANAGARI VOWEL SIGN UU/DEVANAGARI SIGN ANUSVARA
+                 U+0942/U+0901: "ूँ" DEVANAGARI VOWEL SIGN UU/DEVANAGARI SIGN CANDRABINDU -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignUu"
+                latin:moreKeys="&#x0942;&#x0902;,&#x0942;&#x0901;,%" />
+        </case>
+        <default>
+             <key-style
+                latin:styleName="moreKeysDevanagariVowelSignUu" />
+        </default>
+    </switch>
+    <!-- U+0942: "ू" DEVANAGARI VOWEL SIGN UU -->
+    <key-style
+        latin:styleName="baseKeyDevanagariVowelSignUu"
+        latin:parentStyle="moreKeysDevanagariVowelSignUu"
+        latin:keyLabel="&#x0942;"
+        latin:keyLabelFlags="fontNormal" />
+</merge>
diff --git a/java/res/xml/key_nepali_romanized3_shift_center.xml b/java/res/xml/key_devanagari_sign_anusvara.xml
similarity index 86%
rename from java/res/xml/key_nepali_romanized3_shift_center.xml
rename to java/res/xml/key_devanagari_sign_anusvara.xml
index 147f67ab9d3ab3ec17e503ace408b17781b37c82..0acd3bcd432600a45ca1a21dd49aee269a198dbc 100644
--- a/java/res/xml/key_nepali_romanized3_shift_center.xml
+++ b/java/res/xml/key_devanagari_sign_anusvara.xml
@@ -20,8 +20,8 @@
 
 <!-- The code point U+25CC for key label is needed because the font rendering system prior to
      API version 16 can't automatically render dotted circle for incomplete combining letter
-     of Hindi. The files named res/xml/{key,keys}_nepali*.xml have this U+25CC hack, although the
-     counterpart files named res/xml-v16/{key,keys}_nepali*.xml don't have this hack. -->
+     of some scripts. The files named res/xml/key_*.xml have this U+25CC hack, although the
+     counterpart files named res/xml-v16/key_*.xml don't have this hack. -->
 <merge
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
 >
diff --git a/java/res/xml/key_nepali_romanized3_shift_left.xml b/java/res/xml/key_devanagari_sign_candrabindu.xml
similarity index 61%
rename from java/res/xml/key_nepali_romanized3_shift_left.xml
rename to java/res/xml/key_devanagari_sign_candrabindu.xml
index d644fdf26b56da598349fc436990d5fe73668bc7..df0c4e0542980d9ed0bd9f213aef2f538fdb56be 100644
--- a/java/res/xml/key_nepali_romanized3_shift_left.xml
+++ b/java/res/xml/key_devanagari_sign_candrabindu.xml
@@ -20,14 +20,30 @@
 
 <!-- The code point U+25CC for key label is needed because the font rendering system prior to
      API version 16 can't automatically render dotted circle for incomplete combining letter
-     of Hindi. The files named res/xml/{key,keys}_nepali*.xml have this U+25CC hack, although the
-     counterpart files named res/xml-v16/{key,keys}_nepali*.xml don't have this hack. -->
+     of some scripts. The files named res/xml/key_*.xml have this U+25CC hack, although the
+     counterpart files named res/xml-v16/key_*.xml don't have this hack. -->
 <merge
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
 >
+    <switch>
+        <case
+            latin:keyboardLayoutSet="hindi"
+        >
+            <!-- U+25CC: "◌" DOTTED CIRCLE
+                 U+0945: "ॅ" DEVANAGARI VOWEL SIGN CANDRA E -->
+            <key-style
+                latin:styleName="moreKeysDevanagariSignCandrabindu"
+                latin:moreKeys="&#x25CC;&#x0945;|&#x0945;" />
+        </case>
+        <default>
+             <key-style
+                latin:styleName="moreKeysDevanagariSignCandrabindu" />
+        </default>
+    </switch>
     <!-- U+25CC: "◌" DOTTED CIRCLE
          U+0901: "ँ" DEVANAGARI SIGN CANDRABINDU -->
     <Key
+        latin:keyStyle="moreKeysDevanagariSignCandrabindu"
         latin:keyLabel="&#x25CC;&#x0901;"
         latin:code="0x0901"
         latin:keyLabelFlags="fontNormal|followKeyLetterRatio" />
diff --git a/java/res/xml/key_hindi3_right.xml b/java/res/xml/key_devanagari_sign_nukta.xml
similarity index 54%
rename from java/res/xml/key_hindi3_right.xml
rename to java/res/xml/key_devanagari_sign_nukta.xml
index 5a97355f679a5d9249d757beba7644359c06b433..f7a03ee9022298c3eb1097eb74cdd0bb749f9935 100644
--- a/java/res/xml/key_hindi3_right.xml
+++ b/java/res/xml/key_devanagari_sign_nukta.xml
@@ -20,19 +20,33 @@
 
 <!-- The code point U+25CC for key label is needed because the font rendering system prior to
      API version 16 can't automatically render dotted circle for incomplete combining letter
-     of Hindi. The files named res/xml/{key,keys}_hindi*.xml have this U+25CC hack, although the
-     counterpart files named res/xml-v16/{key,keys}_hindi*.xml don't have this hack. -->
+     of some scripts. The files named res/xml/key_*.xml have this U+25CC hack, although the
+     counterpart files named res/xml-v16/key_*.xml don't have this hack. -->
 <merge
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
 >
+    <switch>
+        <case
+            latin:keyboardLayoutSet="hindi"
+        >
+            <!-- U+25CC: "◌" DOTTED CIRCLE
+                 U+097D: "ॽ" DEVANAGARI LETTER GLOTTAL STOP
+                 U+0970: "॰" DEVANAGARI ABBREVIATION SIGN
+                 U+093D: "ऽ" DEVANAGARI SIGN AVAGRAHA -->
+             <key-style
+                latin:styleName="moreKeysDevanagariSignNukta"
+                latin:moreKeys="&#x25CC;&#x097D;|&#x097D;,&#x25CC;&#x0970;|&#x0970;,&#x25CC;&#x093D;|&#x093D;" />
+        </case>
+        <default>
+             <key-style
+                latin:styleName="moreKeysDevanagariSignNukta" />
+        </default>
+    </switch>
     <!-- U+25CC: "◌" DOTTED CIRCLE
-         U+093C: "़" DEVANAGARI SIGN NUKTA
-         U+097D: "ॽ" DEVANAGARI LETTER GLOTTAL STOP
-         U+0970: "॰" DEVANAGARI ABBREVIATION SIGN
-         U+093D: "ऽ" DEVANAGARI SIGN AVAGRAHA -->
+         U+093C: "़" DEVANAGARI SIGN NUKTA -->
     <Key
+        latin:keyStyle="moreKeysDevanagariSignNukta"
         latin:keyLabel="&#x25CC;&#x093C;"
         latin:code="0x093C"
-        latin:moreKeys="&#x25CC;&#x097D;|&#x097D;,&#x25CC;&#x0970;|&#x0970;,&#x25CC;&#x093D;|&#x093D;"
         latin:keyLabelFlags="fontNormal|followKeyLetterRatio" />
 </merge>
diff --git a/java/res/xml/key_nepali_romanized3_shift_right.xml b/java/res/xml/key_devanagari_sign_virama.xml
similarity index 86%
rename from java/res/xml/key_nepali_romanized3_shift_right.xml
rename to java/res/xml/key_devanagari_sign_virama.xml
index 19c1b29aa9ab95592bb43d995db205db82ba6a7d..db7be3ad4767167f9b8cb518f94eb8ab0760233f 100644
--- a/java/res/xml/key_nepali_romanized3_shift_right.xml
+++ b/java/res/xml/key_devanagari_sign_virama.xml
@@ -20,8 +20,8 @@
 
 <!-- The code point U+25CC for key label is needed because the font rendering system prior to
      API version 16 can't automatically render dotted circle for incomplete combining letter
-     of Hindi. The files named res/xml/{key,keys}_nepali*.xml have this U+25CC hack, although the
-     counterpart files named res/xml-v16/{key,keys}_nepali*.xml don't have this hack. -->
+     of some scripts. The files named res/xml/key_*.xml have this U+25CC hack, although the
+     counterpart files named res/xml-v16/key_*.xml don't have this hack. -->
 <merge
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
 >
diff --git a/java/res/xml/key_hindi1_shift.xml b/java/res/xml/key_devanagari_sign_visarga.xml
similarity index 86%
rename from java/res/xml/key_hindi1_shift.xml
rename to java/res/xml/key_devanagari_sign_visarga.xml
index 0db5ae9afa22cfcb7286ce1aaf2e4703bdad6b11..7aa69715453091f4b8b49e474e5e509f0c4d5da8 100644
--- a/java/res/xml/key_hindi1_shift.xml
+++ b/java/res/xml/key_devanagari_sign_visarga.xml
@@ -20,8 +20,8 @@
 
 <!-- The code point U+25CC for key label is needed because the font rendering system prior to
      API version 16 can't automatically render dotted circle for incomplete combining letter
-     of Hindi. The files named res/xml/{key,keys}_hindi*.xml have this U+25CC hack, although the
-     counterpart files named res/xml-v16/{key,keys}_hindi*.xml don't have this hack. -->
+     of some scripts. The files named res/xml/key_*.xml have this U+25CC hack, although the
+     counterpart files named res/xml-v16/key_*.xml don't have this hack. -->
 <merge
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
 >
diff --git a/java/res/xml/key_nepali_romanized3.xml b/java/res/xml/key_devanagari_vowel_sign_candra_o.xml
similarity index 77%
rename from java/res/xml/key_nepali_romanized3.xml
rename to java/res/xml/key_devanagari_vowel_sign_candra_o.xml
index 193c202819ce88646cd7a69ace653864f771099d..370fc5405db0299fb0b1004c325e841fa26bf245 100644
--- a/java/res/xml/key_nepali_romanized3.xml
+++ b/java/res/xml/key_devanagari_vowel_sign_candra_o.xml
@@ -20,15 +20,15 @@
 
 <!-- The code point U+25CC for key label is needed because the font rendering system prior to
      API version 16 can't automatically render dotted circle for incomplete combining letter
-     of Hindi. The files named res/xml/{key,keys}_nepali*.xml have this U+25CC hack, although the
-     counterpart files named res/xml-v16/{key,keys}_nepali*.xml don't have this hack. -->
+     of some scripts. The files named res/xml/key_*.xml have this U+25CC hack, although the
+     counterpart files named res/xml-v16/key_*.xml don't have this hack. -->
 <merge
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
 >
     <!-- U+25CC: "◌" DOTTED CIRCLE
-         U+094D: "्" DEVANAGARI SIGN VIRAMA -->
+         U+0949: "ॉ" DEVANAGARI VOWEL SIGN CANDRA O -->
     <Key
-        latin:keyLabel="&#x25CC;&#x094D;"
-        latin:code="0x094D"
+        latin:keyLabel="&#x25CC;&#x0949;"
+        latin:code="0x0949"
         latin:keyLabelFlags="fontNormal|followKeyLetterRatio" />
 </merge>
diff --git a/java/res/xml/keys_nepali_romanized1_shift_left2.xml b/java/res/xml/key_devanagari_vowel_sign_vocalic_r.xml
similarity index 61%
rename from java/res/xml/keys_nepali_romanized1_shift_left2.xml
rename to java/res/xml/key_devanagari_vowel_sign_vocalic_r.xml
index 3e147057b67caf4fb8559bfff455adecfdaa2d51..adc95938e8bae2ea8c0474fe07f5bd65eff4a7b0 100644
--- a/java/res/xml/keys_nepali_romanized1_shift_left2.xml
+++ b/java/res/xml/key_devanagari_vowel_sign_vocalic_r.xml
@@ -20,20 +20,30 @@
 
 <!-- The code point U+25CC for key label is needed because the font rendering system prior to
      API version 16 can't automatically render dotted circle for incomplete combining letter
-     of Hindi. The files named res/xml/{key,keys}_nepali*.xml have this U+25CC hack, although the
-     counterpart files named res/xml-v16/{key,keys}_nepali*.xml don't have this hack. -->
+     of some scripts. The files named res/xml/key_*.xml have this U+25CC hack, although the
+     counterpart files named res/xml-v16/key_*.xml don't have this hack. -->
 <merge
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
 >
-    <!-- U+25CC: "◌" DOTTED CIRCLE
-         U+0948: "ै" DEVANAGARI VOWEL SIGN AI -->
-    <Key
-        latin:keyLabel="&#x25CC;&#x0948;"
-        latin:code="0x0948"
-        latin:keyLabelFlags="fontNormal|followKeyLetterRatio" />
+    <switch>
+        <case
+            latin:keyboardLayoutSet="hindi"
+        >
+            <!-- U+25CC: "◌" DOTTED CIRCLE
+                 U+0944: "ॄ" DEVANAGARI VOWEL SIGN VOCALIC RR -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignVocalicR"
+                latin:moreKeys="&#x25CC;&#x0944;|&#x0944;" />
+        </case>
+        <default>
+             <key-style
+                latin:styleName="moreKeysDevanagariVowelSignVocalicR" />
+        </default>
+    </switch>
     <!-- U+25CC: "◌" DOTTED CIRCLE
          U+0943: "ृ" DEVANAGARI VOWEL SIGN VOCALIC R -->
     <Key
+        latin:keyStyle="moreKeysDevanagariVowelSignVocalicR"
         latin:keyLabel="&#x25CC;&#x0943;"
         latin:code="0x0943"
         latin:keyLabelFlags="fontNormal|followKeyLetterRatio" />
diff --git a/java/res/xml/key_nepali_romanized2_shift.xml b/java/res/xml/key_nepali_romanized2_shift.xml
deleted file mode 100644
index 157b7f69fc1f0be989fd45c3e8a93da6e7698e8d..0000000000000000000000000000000000000000
--- a/java/res/xml/key_nepali_romanized2_shift.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-**
-** Copyright 2013, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<!-- The code point U+25CC for key label is needed because the font rendering system prior to
-     API version 16 can't automatically render dotted circle for incomplete combining letter
-     of Hindi. The files named res/xml/{key,keys}_nepali*.xml have this U+25CC hack, although the
-     counterpart files named res/xml-v16/{key,keys}_nepali*.xml don't have this hack. -->
-<merge
-    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
->
-    <!-- U+25CC: "◌" DOTTED CIRCLE
-         U+0903: "ः" DEVANAGARI SIGN VISARGA -->
-    <Key
-        latin:keyLabel="&#x25CC;&#x0903;"
-        latin:code="0x0903"
-        latin:keyLabelFlags="fontNormal|followKeyLetterRatio" />
-</merge>
diff --git a/java/res/xml/keys_hindi1_left5.xml b/java/res/xml/keys_hindi1_left5.xml
deleted file mode 100644
index 8757afeaf875e60b562a0a1e9b08598762de3134..0000000000000000000000000000000000000000
--- a/java/res/xml/keys_hindi1_left5.xml
+++ /dev/null
@@ -1,85 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-**
-** Copyright 2013, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<!-- The code point U+25CC for key label is needed because the font rendering system prior to
-     API version 16 can't automatically render dotted circle for incomplete combining letter
-     of Hindi. The files named res/xml/{key,keys}_hindi*.xml have this U+25CC hack, although the
-     counterpart files named res/xml-v16/{key,keys}_hindi*.xml don't have this hack. -->
-<merge
-    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
->
-    <!-- U+25CC: "◌" DOTTED CIRCLE
-         U+094C: "ौ" DEVANAGARI VOWEL SIGN AU
-         U+094C/U+0902: "ौं" DEVANAGARI VOWEL SIGN AU/DEVANAGARI SIGN ANUSVARA
-         U+0967: "१" DEVANAGARI DIGIT ONE -->
-    <Key
-        latin:keyLabel="&#x25CC;&#x094C;"
-        latin:code="0x094C"
-        latin:moreKeys="&#x25CC;&#x094C;&#x0902;|&#x094C;&#x0902;,%"
-        latin:keyHintLabel="1"
-        latin:additionalMoreKeys="&#x0967;,1"
-        latin:keyLabelFlags="fontNormal|followKeyLetterRatio" />
-    <!-- U+25CC: "◌" DOTTED CIRCLE
-         U+0948: "ै" DEVANAGARI VOWEL SIGN AI
-         U+0948/U+0902: "ैं" DEVANAGARI VOWEL SIGN AI/DEVANAGARI SIGN ANUSVARA
-         U+0968: "२" DEVANAGARI DIGIT TWO -->
-    <Key
-        latin:keyLabel="&#x25CC;&#x0948;"
-        latin:code="0x0948"
-        latin:moreKeys="&#x25CC;&#x0948;&#x0902;|&#x0948;&#x0902;,%"
-        latin:keyHintLabel="2"
-        latin:additionalMoreKeys="&#x0968;,2"
-        latin:keyLabelFlags="fontNormal|followKeyLetterRatio" />
-    <!-- U+25CC: "◌" DOTTED CIRCLE
-         U+093E: "ा" DEVANAGARI VOWEL SIGN AA
-         U+093E/U+0902: "ां" DEVANAGARI VOWEL SIGN AA/DEVANAGARI SIGN ANUSVARA
-         U+093E/U+0901: "ाँ" DEVANAGARI VOWEL SIGN AA/DEVANAGARI SIGN CANDRABINDU
-         U+0969: "३" DEVANAGARI DIGIT THREE -->
-    <Key
-        latin:keyLabel="&#x25CC;&#x093E;"
-        latin:code="0x093E"
-        latin:moreKeys="&#x25CC;&#x093E;&#x0902;|&#x093E;&#x0902;,&#x25CC;&#x093E;&#x0901;|&#x093E;&#x0901;,%"
-        latin:keyHintLabel="3"
-        latin:additionalMoreKeys="&#x0969;,3"
-        latin:keyLabelFlags="fontNormal|followKeyLetterRatio" />
-    <!-- U+25CC: "◌" DOTTED CIRCLE
-         U+0940: "ी" DEVANAGARI VOWEL SIGN II
-         U+0940/U+0902: "ीं" DEVANAGARI VOWEL SIGN II/DEVANAGARI SIGN ANUSVARA
-         U+096A: "४" DEVANAGARI DIGIT FOUR -->
-    <Key
-        latin:keyLabel="&#x25CC;&#x0940;"
-        latin:code="0x0940"
-        latin:moreKeys="&#x25CC;&#x0940;&#x0902;|&#x0940;&#x0902;,%"
-        latin:keyHintLabel="4"
-        latin:additionalMoreKeys="&#x096A;,4"
-        latin:keyLabelFlags="fontNormal|followKeyLetterRatio" />
-    <!-- U+25CC: "◌" DOTTED CIRCLE
-         U+0942: "ू" DEVANAGARI VOWEL SIGN UU
-         U+0942/U+0902: "ूं" DEVANAGARI VOWEL SIGN UU/DEVANAGARI SIGN ANUSVARA
-         U+0942/U+0901: "ूँ" DEVANAGARI VOWEL SIGN UU/DEVANAGARI SIGN CANDRABINDU
-         U+096B: "५" DEVANAGARI DIGIT FIVE -->
-    <Key
-        latin:keyLabel="&#x25CC;&#x0942;"
-        latin:code="0x0942"
-        latin:moreKeys="&#x25CC;&#x0942;&#x0902;|&#x0942;&#x0902;,&#x25CC;&#x0942;&#x0901;|&#x0942;&#x0901;,%"
-        latin:keyHintLabel="5"
-        latin:additionalMoreKeys="&#x096B;,5"
-        latin:keyLabelFlags="fontNormal|followKeyLetterRatio" />
-</merge>
diff --git a/java/res/xml/keys_hindi2_left5.xml b/java/res/xml/keys_hindi2_left5.xml
deleted file mode 100644
index 4c3a5e0511564251ef90fc92c6629016d8ae4c36..0000000000000000000000000000000000000000
--- a/java/res/xml/keys_hindi2_left5.xml
+++ /dev/null
@@ -1,69 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-**
-** Copyright 2013, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<!-- The code point U+25CC for key label is needed because the font rendering system prior to
-     API version 16 can't automatically render dotted circle for incomplete combining letter
-     of Hindi. The files named res/xml/{key,keys}_hindi*.xml have this U+25CC hack, although the
-     counterpart files named res/xml-v16/{key,keys}_hindi*.xml don't have this hack. -->
-<merge
-    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
->
-    <!-- U+25CC: "◌" DOTTED CIRCLE
-         U+094B: "ो" DEVANAGARI VOWEL SIGN O
-         U+094B/U+0902: "қं" DEVANAGARI VOWEL SIGN O/DEVANAGARI SIGN ANUSVARA
-         U+0949: "ॉ" DEVANAGARI VOWEL SIGN CANDRA O
-         U+094A: "ॊ" DEVANAGARI VOWEL SIGN SHORT O -->
-    <Key
-        latin:keyLabel="&#x25CC;&#x094B;"
-        latin:code="0x094B"
-        latin:moreKeys="&#x25CC;&#x094B;&#x0902;|&#x094B;&#x0902;,&#x25CC;&#x0949;,&#x094A;|&#x0949;,&#x094A;"
-        latin:keyLabelFlags="fontNormal|followKeyLetterRatio" />
-    <!-- U+25CC: "◌" DOTTED CIRCLE
-         U+0947: "े" DEVANAGARI VOWEL SIGN E
-         U+0947/U+0902: "ें" DEVANAGARI VOWEL SIGN E/DEVANAGARI SIGN ANUSVARA -->
-    <Key
-        latin:keyLabel="&#x25CC;&#x0947;"
-        latin:code="0x0947"
-        latin:moreKeys="&#x25CC;&#x0947;&#x0902;|&#x0947;&#x0902;"
-        latin:keyLabelFlags="fontNormal|followKeyLetterRatio" />
-    <!-- U+25CC: "◌" DOTTED CIRCLE
-         U+094D: "्" DEVANAGARI SIGN VIRAMA -->
-    <Key
-        latin:keyLabel="&#x25CC;&#x094D;"
-        latin:code="0x094D"
-        latin:keyLabelFlags="fontNormal|followKeyLetterRatio" />
-    <!-- U+25CC: "◌" DOTTED CIRCLE
-         U+093F: "ि" DEVANAGARI VOWEL SIGN I
-         U+093F/U+0902: "िं" DEVANAGARI VOWEL SIGN I/DEVANAGARI SIGN ANUSVARA -->
-    <Key
-        latin:keyLabel="&#x093F;&#x25CC;"
-        latin:code="0x093F"
-        latin:moreKeys="&#x093F;&#x25CC;&#x0902;|&#x093F;&#x0902;"
-        latin:keyLabelFlags="fontNormal|followKeyLetterRatio" />
-    <!-- U+25CC: "◌" DOTTED CIRCLE
-         U+0941: "ु" DEVANAGARI VOWEL SIGN U
-         U+0941/U+0902: "ुं" DEVANAGARI VOWEL SIGN U/DEVANAGARI SIGN ANUSVARA
-         U+0941/U+0901: "ुँ" DEVANAGARI VOWEL SIGN U/DEVANAGARI SIGN CANDRABINDU -->
-    <Key
-        latin:keyLabel="&#x25CC;&#x0941;"
-        latin:code="0x0941"
-        latin:moreKeys="&#x25CC;&#x0941;&#x0902;|&#x0941;&#x0902;,&#x25CC;&#x0941;&#x0901;|&#x0941;&#x0901;"
-        latin:keyLabelFlags="fontNormal|followKeyLetterRatio" />
-</merge>
diff --git a/java/res/xml/keys_hindi3_left2.xml b/java/res/xml/keys_hindi3_left2.xml
deleted file mode 100644
index 4f1ad16ef7e65f837ae010de979b26dbf95f3384..0000000000000000000000000000000000000000
--- a/java/res/xml/keys_hindi3_left2.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-**
-** Copyright 2013, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<!-- The code point U+25CC for key label is needed because the font rendering system prior to
-     API version 16 can't automatically render dotted circle for incomplete combining letter
-     of Hindi. The files named res/xml/{key,keys}_hindi*.xml have this U+25CC hack, although the
-     counterpart files named res/xml-v16/{key,keys}_hindi*.xml don't have this hack. -->
-<merge
-    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
->
-    <!-- U+25CC: "◌" DOTTED CIRCLE
-         U+0949: "ॉ" DEVANAGARI VOWEL SIGN CANDRA O -->
-    <Key
-        latin:keyLabel="&#x25CC;&#x0949;"
-        latin:code="0x0949"
-        latin:keyLabelFlags="fontNormal|followKeyLetterRatio" />
-    <!-- U+25CC: "◌" DOTTED CIRCLE
-         U+0902: "ं" DEVANAGARI SIGN ANUSVARA -->
-    <Key
-        latin:keyLabel="&#x25CC;&#x0902;"
-        latin:code="0x0902"
-        latin:keyLabelFlags="fontNormal|followKeyLetterRatio" />
-</merge>
diff --git a/java/res/xml/key_nepali_romanized2.xml b/java/res/xml/keystyle_devanagari_vowel_sign_aa.xml
similarity index 54%
rename from java/res/xml/key_nepali_romanized2.xml
rename to java/res/xml/keystyle_devanagari_vowel_sign_aa.xml
index 0b01ebca5d9c253919b0fe6c5729aaeaced58735..2e78c53ec76e78197265ca8c96fc7136564a4920 100644
--- a/java/res/xml/key_nepali_romanized2.xml
+++ b/java/res/xml/keystyle_devanagari_vowel_sign_aa.xml
@@ -20,14 +20,32 @@
 
 <!-- The code point U+25CC for key label is needed because the font rendering system prior to
      API version 16 can't automatically render dotted circle for incomplete combining letter
-     of Hindi. The files named res/xml/{key,keys}_nepali*.xml have this U+25CC hack, although the
-     counterpart files named res/xml-v16/{key,keys}_nepali*.xml don't have this hack. -->
+     of some scripts. The files named res/xml/key_*.xml have this U+25CC hack, although the
+     counterpart files named res/xml-v16/key_*.xml don't have this hack. -->
 <merge
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
 >
+    <switch>
+        <case
+            latin:keyboardLayoutSet="hindi"
+        >
+            <!-- U+25CC: "◌" DOTTED CIRCLE
+                 U+093E/U+0902: "ां" DEVANAGARI VOWEL SIGN AA/DEVANAGARI SIGN ANUSVARA
+                 U+093E/U+0901: "ाँ" DEVANAGARI VOWEL SIGN AA/DEVANAGARI SIGN CANDRABINDU -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignAa"
+                latin:moreKeys="&#x25CC;&#x093E;&#x0902;|&#x093E;&#x0902;,&#x25CC;&#x093E;&#x0901;|&#x093E;&#x0901;,%" />
+        </case>
+        <default>
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignAa" />
+        </default>
+    </switch>
     <!-- U+25CC: "◌" DOTTED CIRCLE
          U+093E: "ा" DEVANAGARI VOWEL SIGN AA -->
-    <Key
+    <key-style
+        latin:styleName="baseKeyDevanagariVowelSignAa"
+        latin:parentStyle="moreKeysDevanagariVowelSignAa"
         latin:keyLabel="&#x25CC;&#x093E;"
         latin:code="0x093E"
         latin:keyLabelFlags="fontNormal|followKeyLetterRatio" />
diff --git a/java/res/xml/key_hindi3_shift_right.xml b/java/res/xml/keystyle_devanagari_vowel_sign_ai.xml
similarity index 52%
rename from java/res/xml/key_hindi3_shift_right.xml
rename to java/res/xml/keystyle_devanagari_vowel_sign_ai.xml
index 0da116ab84f3f95e1bda5d4d754b169b8390e7dd..0c374faed3c63019a9909a15dfebde3e69372cb0 100644
--- a/java/res/xml/key_hindi3_shift_right.xml
+++ b/java/res/xml/keystyle_devanagari_vowel_sign_ai.xml
@@ -20,17 +20,32 @@
 
 <!-- The code point U+25CC for key label is needed because the font rendering system prior to
      API version 16 can't automatically render dotted circle for incomplete combining letter
-     of Hindi. The files named res/xml/{key,keys}_hindi*.xml have this U+25CC hack, although the
-     counterpart files named res/xml-v16/{key,keys}_hindi*.xml don't have this hack. -->
+     of some scripts. The files named res/xml/key_*.xml have this U+25CC hack, although the
+     counterpart files named res/xml-v16/key_*.xml don't have this hack. -->
 <merge
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
 >
+    <switch>
+        <case
+            latin:keyboardLayoutSet="hindi"
+        >
+            <!-- U+25CC: "◌" DOTTED CIRCLE
+                 U+0948/U+0902: "ैं" DEVANAGARI VOWEL SIGN AI/DEVANAGARI SIGN ANUSVARA -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignAi"
+                latin:moreKeys="&#x25CC;&#x0948;&#x0902;|&#x0948;&#x0902;,%" />
+        </case>
+        <default>
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignAi" />
+        </default>
+    </switch>
     <!-- U+25CC: "◌" DOTTED CIRCLE
-         U+0943: "ृ" DEVANAGARI VOWEL SIGN VOCALIC R
-         U+0944: "ॄ" DEVANAGARI VOWEL SIGN VOCALIC RR -->
-    <Key
-        latin:keyLabel="&#x25CC;&#x0943;"
-        latin:code="0x0943"
-        latin:moreKeys="&#x25CC;&#x0944;|&#x0944;"
+         U+0948: "ै" DEVANAGARI VOWEL SIGN AI -->
+    <key-style
+        latin:styleName="baseKeyDevanagariVowelSignAi"
+        latin:parentStyle="moreKeysDevanagariVowelSignAi"
+        latin:keyLabel="&#x25CC;&#x0948;"
+        latin:code="0x0948"
         latin:keyLabelFlags="fontNormal|followKeyLetterRatio" />
 </merge>
diff --git a/java/res/xml/keystyle_devanagari_vowel_sign_au.xml b/java/res/xml/keystyle_devanagari_vowel_sign_au.xml
new file mode 100644
index 0000000000000000000000000000000000000000..29a11a82e0b42ddaace2d82ffefe72a1da69c7d1
--- /dev/null
+++ b/java/res/xml/keystyle_devanagari_vowel_sign_au.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2013, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<!-- The code point U+25CC for key label is needed because the font rendering system prior to
+     API version 16 can't automatically render dotted circle for incomplete combining letter
+     of some scripts. The files named res/xml/key_*.xml have this U+25CC hack, although the
+     counterpart files named res/xml-v16/key_*.xml don't have this hack. -->
+<merge
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+    <switch>
+        <case
+            latin:keyboardLayoutSet="hindi"
+        >
+            <!-- U+25CC: "◌" DOTTED CIRCLE
+                U+094C/U+0902: "ौं" DEVANAGARI VOWEL SIGN AU/DEVANAGARI SIGN ANUSVARA -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignAu"
+                latin:moreKeys="&#x25CC;&#x094C;&#x0902;|&#x094C;&#x0902;,%" />
+        </case>
+        <default>
+             <key-style
+                latin:styleName="moreKeysDevanagariVowelSignAu" />
+        </default>
+    </switch>
+    <!-- U+094C: "ौ" DEVANAGARI VOWEL SIGN AU -->
+    <key-style
+        latin:styleName="baseKeyDevanagariVowelSignAu"
+        latin:parentStyle="moreKeysDevanagariVowelSignAu"
+        latin:keyLabel="&#x25CC;&#x094C;"
+        latin:code="0x094C"
+        latin:keyLabelFlags="fontNormal|followKeyLetterRatio" />
+</merge>
diff --git a/java/res/xml/keys_nepali_romanized1_left2.xml b/java/res/xml/keystyle_devanagari_vowel_sign_e.xml
similarity index 56%
rename from java/res/xml/keys_nepali_romanized1_left2.xml
rename to java/res/xml/keystyle_devanagari_vowel_sign_e.xml
index 5b92cc344124167e49ec15b0f3f4d5c4bb06132d..2f1c5baf883aa2b94bb5ab8afa68c2b3fd5ddfbf 100644
--- a/java/res/xml/keys_nepali_romanized1_left2.xml
+++ b/java/res/xml/keystyle_devanagari_vowel_sign_e.xml
@@ -20,27 +20,30 @@
 
 <!-- The code point U+25CC for key label is needed because the font rendering system prior to
      API version 16 can't automatically render dotted circle for incomplete combining letter
-     of Hindi. The files named res/xml/{key,keys}_nepali*.xml have this U+25CC hack, although the
-     counterpart files named res/xml-v16/{key,keys}_nepali*.xml don't have this hack. -->
+     of some scripts. The files named res/xml/key_*.xml have this U+25CC hack, although the
+     counterpart files named res/xml-v16/key_*.xml don't have this hack. -->
 <merge
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
 >
-    <!-- U+25CC: "◌" DOTTED CIRCLE
-         U+094C: "ौ" DEVANAGARI VOWEL SIGN AU
-         U+0968: "२" DEVANAGARI DIGIT TWO -->
-    <Key
-        latin:keyLabel="&#x25CC;&#x094C;"
-        latin:code="0x094C"
-        latin:keyHintLabel="2"
-        latin:additionalMoreKeys="&#x0968;,2"
-        latin:keyLabelFlags="fontNormal|followKeyLetterRatio" />
-    <!-- U+25CC: "◌" DOTTED CIRCLE
-         U+0947: "े" DEVANAGARI VOWEL SIGN E
-         U+0969: "३" DEVANAGARI DIGIT THREE -->
-    <Key
+    <switch>
+        <case
+            latin:keyboardLayoutSet="hindi"
+        >
+            <!-- U+25CC: "◌" DOTTED CIRCLE
+                 U+0947/U+0902: "ें" DEVANAGARI VOWEL SIGN E/DEVANAGARI SIGN ANUSVARA -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignE"
+                latin:moreKeys="&#x25CC;&#x0947;&#x0902;|&#x0947;&#x0902;" />
+        </case>
+        <default>
+             <key-style
+                latin:styleName="moreKeysDevanagariVowelSignE" />
+        </default>
+    </switch>
+    <key-style
+        latin:styleName="baseKeyDevanagariVowelSignE"
+        latin:parentStyle="moreKeysDevanagariVowelSignE"
         latin:keyLabel="&#x25CC;&#x0947;"
         latin:code="0x0947"
-        latin:keyHintLabel="3"
-        latin:additionalMoreKeys="&#x0969;,3"
         latin:keyLabelFlags="fontNormal|followKeyLetterRatio" />
 </merge>
diff --git a/java/res/xml/key_hindi3_shift_left.xml b/java/res/xml/keystyle_devanagari_vowel_sign_i.xml
similarity index 52%
rename from java/res/xml/key_hindi3_shift_left.xml
rename to java/res/xml/keystyle_devanagari_vowel_sign_i.xml
index c5e2f13868fb14005808587876b00b022a612259..200fed29fa43743bc2cbf37b020333308c2028e6 100644
--- a/java/res/xml/key_hindi3_shift_left.xml
+++ b/java/res/xml/keystyle_devanagari_vowel_sign_i.xml
@@ -20,17 +20,32 @@
 
 <!-- The code point U+25CC for key label is needed because the font rendering system prior to
      API version 16 can't automatically render dotted circle for incomplete combining letter
-     of Hindi. The files named res/xml/{key,keys}_hindi*.xml have this U+25CC hack, although the
-     counterpart files named res/xml-v16/{key,keys}_hindi*.xml don't have this hack. -->
+     of some scripts. The files named res/xml/key_*.xml have this U+25CC hack, although the
+     counterpart files named res/xml-v16/key_*.xml don't have this hack. -->
 <merge
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
 >
+    <switch>
+        <case
+            latin:keyboardLayoutSet="hindi"
+        >
+            <!-- U+25CC: "◌" DOTTED CIRCLE
+                 U+093F/U+0902: "िं" DEVANAGARI VOWEL SIGN I/DEVANAGARI SIGN ANUSVARA -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignI"
+                latin:moreKeys="&#x093F;&#x25CC;&#x0902;|&#x093F;&#x0902;" />
+        </case>
+        <default>
+             <key-style
+                latin:styleName="moreKeysDevanagariVowelSignI" />
+        </default>
+    </switch>
     <!-- U+25CC: "◌" DOTTED CIRCLE
-         U+0901: "ँ" DEVANAGARI SIGN CANDRABINDU
-         U+0945: "ॅ" DEVANAGARI VOWEL SIGN CANDRA E -->
-    <Key
-        latin:keyLabel="&#x25CC;&#x0901;"
-        latin:code="0x0901"
-        latin:moreKeys="&#x25CC;&#x0945;|&#x0945;"
+         U+093F: "ि" DEVANAGARI VOWEL SIGN I -->
+    <key-style
+        latin:styleName="baseKeyDevanagariVowelSignI"
+        latin:parentStyle="moreKeysDevanagariVowelSignI"
+        latin:keyLabel="&#x25CC;&#x093F;"
+        latin:code="0x093F"
         latin:keyLabelFlags="fontNormal|followKeyLetterRatio" />
 </merge>
diff --git a/java/res/xml/keys_nepali_romanized1_shift_right2.xml b/java/res/xml/keystyle_devanagari_vowel_sign_ii.xml
similarity index 57%
rename from java/res/xml/keys_nepali_romanized1_shift_right2.xml
rename to java/res/xml/keystyle_devanagari_vowel_sign_ii.xml
index 650bcf96974c8ab99f2ec1ba5b9cbbb3335193b2..6dc9951df1a0e98935aa6b0f42ba979edf4d303d 100644
--- a/java/res/xml/keys_nepali_romanized1_shift_right2.xml
+++ b/java/res/xml/keystyle_devanagari_vowel_sign_ii.xml
@@ -20,20 +20,31 @@
 
 <!-- The code point U+25CC for key label is needed because the font rendering system prior to
      API version 16 can't automatically render dotted circle for incomplete combining letter
-     of Hindi. The files named res/xml/{key,keys}_nepali*.xml have this U+25CC hack, although the
-     counterpart files named res/xml-v16/{key,keys}_nepali*.xml don't have this hack. -->
+     of some scripts. The files named res/xml/key_*.xml have this U+25CC hack, although the
+     counterpart files named res/xml-v16/key_*.xml don't have this hack. -->
 <merge
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
 >
-    <!-- U+25CC: "◌" DOTTED CIRCLE
-         U+0942: "ू" DEVANAGARI VOWEL SIGN UU -->
-    <Key
-        latin:keyLabel="&#x25CC;&#x0942;"
-        latin:code="0x0942"
-        latin:keyLabelFlags="fontNormal|followKeyLetterRatio" />
+    <switch>
+        <case
+            latin:keyboardLayoutSet="hindi"
+        >
+            <!-- U+0940: "ी" DEVANAGARI VOWEL SIGN II
+                 U+0940/U+0902: "ीं" DEVANAGARI VOWEL SIGN II/DEVANAGARI SIGN ANUSVARA -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignIi"
+                latin:moreKeys="&#x25CC;&#x0940;&#x0902;|&#x0940;&#x0902;,%" />
+        </case>
+        <default>
+             <key-style
+                latin:styleName="moreKeysDevanagariVowelSignIi" />
+        </default>
+    </switch>
     <!-- U+25CC: "◌" DOTTED CIRCLE
          U+0940: "ी" DEVANAGARI VOWEL SIGN II -->
-    <Key
+    <key-style
+        latin:styleName="baseKeyDevanagariVowelSignIi"
+        latin:parentStyle="moreKeysDevanagariVowelSignIi"
         latin:keyLabel="&#x25CC;&#x0940;"
         latin:code="0x0940"
         latin:keyLabelFlags="fontNormal|followKeyLetterRatio" />
diff --git a/java/res/xml/keys_nepali_romanized1_right3.xml b/java/res/xml/keystyle_devanagari_vowel_sign_o.xml
similarity index 51%
rename from java/res/xml/keys_nepali_romanized1_right3.xml
rename to java/res/xml/keystyle_devanagari_vowel_sign_o.xml
index c946ee660dddfe7642291a5dac1ef7346e57892c..233ac8609e6d1bd1d05d6316d52f78532b790d2d 100644
--- a/java/res/xml/keys_nepali_romanized1_right3.xml
+++ b/java/res/xml/keystyle_devanagari_vowel_sign_o.xml
@@ -20,36 +20,34 @@
 
 <!-- The code point U+25CC for key label is needed because the font rendering system prior to
      API version 16 can't automatically render dotted circle for incomplete combining letter
-     of Hindi. The files named res/xml/{key,keys}_nepali*.xml have this U+25CC hack, although the
-     counterpart files named res/xml-v16/{key,keys}_nepali*.xml don't have this hack. -->
+     of some scripts. The files named res/xml/key_*.xml have this U+25CC hack, although the
+     counterpart files named res/xml-v16/key_*.xml don't have this hack. -->
 <merge
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
 >
+    <switch>
+        <case
+            latin:keyboardLayoutSet="hindi"
+        >
+            <!-- U+25CC: "◌" DOTTED CIRCLE
+                 U+094B/U+0902: "қं" DEVANAGARI VOWEL SIGN O/DEVANAGARI SIGN ANUSVARA
+                 U+0949: "ॉ" DEVANAGARI VOWEL SIGN CANDRA O
+                 U+094A: "ॊ" DEVANAGARI VOWEL SIGN SHORT O -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignO"
+                latin:moreKeys="&#x25CC;&#x094B;&#x0902;|&#x094B;&#x0902;,&#x25CC;&#x0949;|&#x0949;,&#x25CC;&#x094A;|&#x094A;" />
+        </case>
+        <default>
+             <key-style
+                latin:styleName="moreKeysDevanagariVowelSignO" />
+        </default>
+    </switch>
     <!-- U+25CC: "◌" DOTTED CIRCLE
-         U+0941: "ु" DEVANAGARI VOWEL SIGN U
-         U+096D: "७" DEVANAGARI DIGIT SEVEN -->
-    <Key
-        latin:keyLabel="&#x25CC;&#x0941;"
-        latin:code="0x0941"
-        latin:keyHintLabel="7"
-        latin:additionalMoreKeys="&#x096D;,7"
-        latin:keyLabelFlags="fontNormal|followKeyLetterRatio" />
-    <!-- U+25CC: "◌" DOTTED CIRCLE
-         U+093F: "ि" DEVANAGARI VOWEL SIGN I
-         U+096E: "८" DEVANAGARI DIGIT EIGHT -->
-    <Key
-        latin:keyLabel="&#x25CC;&#x093F;"
-        latin:code="0x093F"
-        latin:keyHintLabel="8"
-        latin:additionalMoreKeys="&#x096E;,8"
-        latin:keyLabelFlags="fontNormal|followKeyLetterRatio" />
-    <!-- U+25CC: "◌" DOTTED CIRCLE
-         U+094B: "ो" DEVANAGARI VOWEL SIGN O
-         U+096F: "९" DEVANAGARI DIGIT NINE -->
-    <Key
+         U+094B: "ो" DEVANAGARI VOWEL SIGN O -->
+    <key-style
+        latin:styleName="baseKeyDevanagariVowelSignO"
+        latin:parentStyle="moreKeysDevanagariVowelSignO"
         latin:keyLabel="&#x25CC;&#x094B;"
         latin:code="0x094B"
-        latin:keyHintLabel="9"
-        latin:additionalMoreKeys="&#x096F;,9"
         latin:keyLabelFlags="fontNormal|followKeyLetterRatio" />
 </merge>
diff --git a/java/res/xml/keystyle_devanagari_vowel_sign_u.xml b/java/res/xml/keystyle_devanagari_vowel_sign_u.xml
new file mode 100644
index 0000000000000000000000000000000000000000..7291b7099aaa1eec089f2d4e77c9f26fa4d65eb7
--- /dev/null
+++ b/java/res/xml/keystyle_devanagari_vowel_sign_u.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2013, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<!-- The code point U+25CC for key label is needed because the font rendering system prior to
+     API version 16 can't automatically render dotted circle for incomplete combining letter
+     of some scripts. The files named res/xml/key_*.xml have this U+25CC hack, although the
+     counterpart files named res/xml-v16/key_*.xml don't have this hack. -->
+<merge
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+    <switch>
+        <case
+            latin:keyboardLayoutSet="hindi"
+        >
+            <!-- U+25CC: "◌" DOTTED CIRCLE
+                 U+0941/U+0902: "ुं" DEVANAGARI VOWEL SIGN U/DEVANAGARI SIGN ANUSVARA
+                 U+0941/U+0901: "ुँ" DEVANAGARI VOWEL SIGN U/DEVANAGARI SIGN CANDRABINDU -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignU"
+                latin:moreKeys="&#x25CC;&#x0941;&#x0902;|&#x0941;&#x0902;,&#x25CC;&#x0941;&#x0901;|&#x0941;&#x0901;" />
+        </case>
+        <default>
+             <key-style
+                latin:styleName="moreKeysDevanagariVowelSignU" />
+        </default>
+    </switch>
+    <!-- U+25CC: "◌" DOTTED CIRCLE
+         U+0941: "ु" DEVANAGARI VOWEL SIGN U -->
+    <key-style
+        latin:styleName="baseKeyDevanagariVowelSignU"
+        latin:parentStyle="moreKeysDevanagariVowelSignU"
+        latin:keyLabel="&#x25CC;&#x0941;"
+        latin:code="0x0941"
+        latin:keyLabelFlags="fontNormal|followKeyLetterRatio" />
+</merge>
diff --git a/java/res/xml/keystyle_devanagari_vowel_sign_uu.xml b/java/res/xml/keystyle_devanagari_vowel_sign_uu.xml
new file mode 100644
index 0000000000000000000000000000000000000000..a95ab822dc9e42e1cf28f4c1e441955b4d9ff5ca
--- /dev/null
+++ b/java/res/xml/keystyle_devanagari_vowel_sign_uu.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2013, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<!-- The code point U+25CC for key label is needed because the font rendering system prior to
+     API version 16 can't automatically render dotted circle for incomplete combining letter
+     of some scripts. The files named res/xml/key_*.xml have this U+25CC hack, although the
+     counterpart files named res/xml-v16/key_*.xml don't have this hack. -->
+<merge
+    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+    <switch>
+        <case
+            latin:keyboardLayoutSet="hindi"
+        >
+            <!-- U+25CC: "◌" DOTTED CIRCLE
+                 U+0942/U+0902: "ूं" DEVANAGARI VOWEL SIGN UU/DEVANAGARI SIGN ANUSVARA
+                 U+0942/U+0901: "ूँ" DEVANAGARI VOWEL SIGN UU/DEVANAGARI SIGN CANDRABINDU -->
+            <key-style
+                latin:styleName="moreKeysDevanagariVowelSignUu"
+                latin:moreKeys="&#x25CC;&#x0942;&#x0902;|&#x0942;&#x0902;,&#x25CC;&#x0942;&#x0901;|&#x0942;&#x0901;,%" />
+        </case>
+        <default>
+             <key-style
+                latin:styleName="moreKeysDevanagariVowelSignUu" />
+        </default>
+    </switch>
+    <!-- U+25CC: "◌" DOTTED CIRCLE
+         U+0942: "ू" DEVANAGARI VOWEL SIGN UU -->
+    <key-style
+        latin:styleName="baseKeyDevanagariVowelSignUu"
+        latin:parentStyle="moreKeysDevanagariVowelSignUu"
+        latin:keyLabel="&#x25CC;&#x0942;"
+        latin:code="0x0942"
+        latin:keyLabelFlags="fontNormal|followKeyLetterRatio" />
+</merge>
diff --git a/java/res/xml/rowkeys_hindi1.xml b/java/res/xml/rowkeys_hindi1.xml
index c66d2134647d7e1d54de1c0da439e7693874a78e..62ae9dbd230648e43b8552e5629a0ba44736d2a1 100644
--- a/java/res/xml/rowkeys_hindi1.xml
+++ b/java/res/xml/rowkeys_hindi1.xml
@@ -62,10 +62,10 @@
                 latin:keyLabel="&#x092D;"
                 latin:keyLabelFlags="fontNormal" />
             <!-- Because the font rendering system prior to API version 16 can't automatically
-                 render dotted circle for incomplete combining letter of Hindi, different set of
-                 Key definitions are needed based on the API version. -->
+                 render dotted circle for incomplete combining letter of some scripts, different
+                 set of Key definitions are needed based on the API version. -->
             <include
-                latin:keyboardLayout="@xml/key_hindi1_shift" />
+                latin:keyboardLayout="@xml/key_devanagari_sign_visarga" />
             <!-- U+0918: "घ" DEVANAGARI LETTER GHA -->
             <Key
                 latin:keyLabel="&#x0918;"
@@ -88,10 +88,55 @@
         </case>
         <default>
             <!-- Because the font rendering system prior to API version 16 can't automatically
-                 render dotted circle for incomplete combining letter of Hindi, different set of
-                 Key definitions are needed based on the API version. -->
+                 render dotted circle for incomplete combining letter of some scripts, different
+                 set of Key definitions are needed based on the API version. -->
+            <!-- U+0967: "१" DEVANAGARI DIGIT ONE -->
             <include
-                latin:keyboardLayout="@xml/keys_hindi1_left5" />
+                latin:keyboardLayout="@xml/keystyle_devanagari_vowel_sign_au" />
+            <Key
+                latin:keyStyle="baseKeyDevanagariVowelSignAu"
+                latin:keyHintLabel="1"
+                latin:additionalMoreKeys="&#x0967;,1" />
+            <!-- Because the font rendering system prior to API version 16 can't automatically
+                 render dotted circle for incomplete combining letter of some scripts, different
+                 set of Key definitions are needed based on the API version. -->
+            <!-- U+0968: "२" DEVANAGARI DIGIT TWO -->
+            <include
+                latin:keyboardLayout="@xml/keystyle_devanagari_vowel_sign_ai" />
+            <Key
+                latin:keyStyle="baseKeyDevanagariVowelSignAi"
+                latin:keyHintLabel="2"
+                latin:additionalMoreKeys="&#x0968;,2" />
+            <!-- Because the font rendering system prior to API version 16 can't automatically
+                 render dotted circle for incomplete combining letter of some scripts, different
+                 set of Key definitions are needed based on the API version. -->
+            <!-- U+0969: "३" DEVANAGARI DIGIT THREE -->
+            <include
+                latin:keyboardLayout="@xml/keystyle_devanagari_vowel_sign_aa" />
+            <Key
+                latin:keyStyle="baseKeyDevanagariVowelSignAa"
+                latin:keyHintLabel="3"
+                latin:additionalMoreKeys="&#x0969;,3" />
+            <!-- Because the font rendering system prior to API version 16 can't automatically
+                 render dotted circle for incomplete combining letter of some scripts, different
+                 set of Key definitions are needed based on the API version. -->
+            <!-- U+096A: "४" DEVANAGARI DIGIT FOUR -->
+            <include
+                latin:keyboardLayout="@xml/keystyle_devanagari_vowel_sign_ii" />
+            <Key
+                latin:keyStyle="baseKeyDevanagariVowelSignIi"
+                latin:keyHintLabel="4"
+                latin:additionalMoreKeys="&#x096A;,4" />
+            <!-- Because the font rendering system prior to API version 16 can't automatically
+                 render dotted circle for incomplete combining letter of some scripts, different
+                 set of Key definitions are needed based on the API version. -->
+            <!-- U+096B: "५" DEVANAGARI DIGIT FIVE -->
+            <include
+                latin:keyboardLayout="@xml/keystyle_devanagari_vowel_sign_uu" />
+            <Key
+                latin:keyStyle="baseKeyDevanagariVowelSignUu"
+                latin:keyHintLabel="5"
+                latin:additionalMoreKeys="&#x096B;,5" />
             <!-- U+092C: "ब" DEVANAGARI LETTER BA
                  U+096C: "६" DEVANAGARI DIGIT SIX
                  U+092C/U+0952: "ब॒" DEVANAGARI LETTER BA/DEVANAGARI STRESS SIGN ANUDATTA -->
diff --git a/java/res/xml/rowkeys_hindi2.xml b/java/res/xml/rowkeys_hindi2.xml
index 9545b840f70558aab0773628b90f51ac381c9b46..4fd00f07e68e6eee7621880d518ee07bd6f3cb56 100644
--- a/java/res/xml/rowkeys_hindi2.xml
+++ b/java/res/xml/rowkeys_hindi2.xml
@@ -97,10 +97,38 @@
         </case>
         <default>
             <!-- Because the font rendering system prior to API version 16 can't automatically
-                 render dotted circle for incomplete combining letter of Hindi, different set of
-                 Key definitions are needed based on the API version. -->
+                 render dotted circle for incomplete combining letter of some scripts, different
+                 set of Key definitions are needed based on the API version. -->
             <include
-                latin:keyboardLayout="@xml/keys_hindi2_left5" />
+                latin:keyboardLayout="@xml/keystyle_devanagari_vowel_sign_o" />
+            <Key
+                latin:keyStyle="baseKeyDevanagariVowelSignO" />
+            <!-- Because the font rendering system prior to API version 16 can't automatically
+                 render dotted circle for incomplete combining letter of some scripts, different
+                 set of Key definitions are needed based on the API version. -->
+            <include
+                latin:keyboardLayout="@xml/keystyle_devanagari_vowel_sign_e" />
+            <Key
+                latin:keyStyle="baseKeyDevanagariVowelSignE" />
+            <!-- Because the font rendering system prior to API version 16 can't automatically
+                 render dotted circle for incomplete combining letter of some scripts, different
+                 set of Key definitions are needed based on the API version. -->
+            <include
+                latin:keyboardLayout="@xml/key_devanagari_sign_virama" />
+            <!-- Because the font rendering system prior to API version 16 can't automatically
+                 render dotted circle for incomplete combining letter of some scripts, different
+                 set of Key definitions are needed based on the API version. -->
+            <include
+                latin:keyboardLayout="@xml/keystyle_devanagari_vowel_sign_i" />
+            <Key
+                latin:keyStyle="baseKeyDevanagariVowelSignI" />
+            <!-- Because the font rendering system prior to API version 16 can't automatically
+                 render dotted circle for incomplete combining letter of some scripts, different
+                 set of Key definitions are needed based on the API version. -->
+            <include
+                latin:keyboardLayout="@xml/keystyle_devanagari_vowel_sign_u" />
+            <Key
+                latin:keyStyle="baseKeyDevanagariVowelSignU" />
             <!-- U+092A: "प" DEVANAGARI LETTER PA -->
             <Key
                 latin:keyLabel="&#x092A;"
diff --git a/java/res/xml/rowkeys_hindi3.xml b/java/res/xml/rowkeys_hindi3.xml
index 3014907edf5d0f17c1c279d4342bed5ee17d9aff..136bc5f228970555d0ca68f3f440f3e594ab9596 100644
--- a/java/res/xml/rowkeys_hindi3.xml
+++ b/java/res/xml/rowkeys_hindi3.xml
@@ -30,10 +30,10 @@
                 latin:keyLabel="&#x0911;"
                 latin:keyLabelFlags="fontNormal" />
             <!-- Because the font rendering system prior to API version 16 can't automatically
-                 render dotted circle for incomplete combining letter of Hindi, different set of
-                 Key definitions are needed based on the API version. -->
+                 render dotted circle for incomplete combining letter of some scripts, different
+                 set of Key definitions are needed based on the API version. -->
             <include
-                latin:keyboardLayout="@xml/key_hindi3_shift_left" />
+                latin:keyboardLayout="@xml/key_devanagari_sign_candrabindu" />
             <!-- U+0923: "ण" DEVANAGARI LETTER NNA -->
             <Key
                 latin:keyLabel="&#x0923;"
@@ -56,10 +56,10 @@
                 latin:keyLabel="&#x0937;"
                 latin:keyLabelFlags="fontNormal" />
             <!-- Because the font rendering system prior to API version 16 can't automatically
-                 render dotted circle for incomplete combining letter of Hindi, different set of
-                 Key definitions are needed based on the API version. -->
+                 render dotted circle for incomplete combining letter of some scripts, different
+                 set of Key definitions are needed based on the API version. -->
             <include
-                latin:keyboardLayout="@xml/key_hindi3_shift_right" />
+                latin:keyboardLayout="@xml/key_devanagari_vowel_sign_vocalic_r" />
             <!-- U+091E: "ञ" DEVANAGARI LETTER NYA -->
             <Key
                 latin:keyLabel="&#x091E;"
@@ -67,10 +67,12 @@
         </case>
         <default>
             <!-- Because the font rendering system prior to API version 16 can't automatically
-                 render dotted circle for incomplete combining letter of Hindi, different set of
-                 Key definitions are needed based on the API version. -->
+                 render dotted circle for incomplete combining letter of some scripts, different
+                 set of Key definitions are needed based on the API version. -->
             <include
-                latin:keyboardLayout="@xml/keys_hindi3_left2" />
+                latin:keyboardLayout="@xml/key_devanagari_vowel_sign_candra_o" />
+            <include
+                latin:keyboardLayout="@xml/key_devanagari_sign_anusvara" />
             <!-- U+092E: "म" DEVANAGARI LETTER MA
                  U+0950: "ॐ" DEVANAGARI OM -->
             <Key
@@ -107,10 +109,10 @@
                 latin:moreKeys="&#x095F;"
                 latin:keyLabelFlags="fontNormal" />
             <!-- Because the font rendering system prior to API version 16 can't automatically
-                 render dotted circle for incomplete combining letter of Hindi, different set of
-                 Key definitions are needed based on the API version. -->
+                 render dotted circle for incomplete combining letter of some scripts, different
+                 set of Key definitions are needed based on the API version. -->
             <include
-                latin:keyboardLayout="@xml/key_hindi3_right" />
+                latin:keyboardLayout="@xml/key_devanagari_sign_nukta" />
          </default>
     </switch>
 </merge>
diff --git a/java/res/xml/rowkeys_nepali_romanized1.xml b/java/res/xml/rowkeys_nepali_romanized1.xml
index c0951f3e9f509469b27ff72764d2e054bf7d8d02..408a96648815263dd668516786619c6665c2e122 100644
--- a/java/res/xml/rowkeys_nepali_romanized1.xml
+++ b/java/res/xml/rowkeys_nepali_romanized1.xml
@@ -34,10 +34,17 @@
                 latin:keyLabel="&#x0914;"
                 latin:keyLabelFlags="fontNormal" />
             <!-- Because the font rendering system prior to API version 16 can't automatically
-                 render dotted circle for incomplete combining letter of Hindi, different set of
-                 Key definitions are needed based on the API version. -->
+                 render dotted circle for incomplete combining letter of some scripts, different
+                 set of Key definitions are needed based on the API version. -->
             <include
-                latin:keyboardLayout="@xml/keys_nepali_romanized1_shift_left2" />
+                latin:keyboardLayout="@xml/keystyle_devanagari_vowel_sign_ai" />
+            <Key
+                latin:keyStyle="baseKeyDevanagariVowelSignAi" />
+            <!-- Because the font rendering system prior to API version 16 can't automatically
+                 render dotted circle for incomplete combining letter of some scripts, different
+                 set of Key definitions are needed based on the API version. -->
+            <include
+                latin:keyboardLayout="@xml/key_devanagari_vowel_sign_vocalic_r" />
             <!-- U+0925: "थ" DEVANAGARI LETTER THA -->
             <Key
                 latin:keyLabel="&#x0925;"
@@ -47,10 +54,19 @@
                 latin:keyLabel="&#x091E;"
                 latin:keyLabelFlags="fontNormal" />
             <!-- Because the font rendering system prior to API version 16 can't automatically
-                 render dotted circle for incomplete combining letter of Hindi, different set of
-                 Key definitions are needed based on the API version. -->
+                 render dotted circle for incomplete combining letter of some scripts, different
+                 set of Key definitions are needed based on the API version. -->
             <include
-                latin:keyboardLayout="@xml/keys_nepali_romanized1_shift_right2" />
+                latin:keyboardLayout="@xml/keystyle_devanagari_vowel_sign_uu" />
+            <Key
+                latin:keyStyle="baseKeyDevanagariVowelSignUu" />
+            <!-- Because the font rendering system prior to API version 16 can't automatically
+                 render dotted circle for incomplete combining letter of some scripts, different
+                 set of Key definitions are needed based on the API version. -->
+            <include
+                latin:keyboardLayout="@xml/keystyle_devanagari_vowel_sign_ii" />
+            <Key
+                latin:keyStyle="baseKeyDevanagariVowelSignIi" />
             <!-- U+0913: "ओ" DEVANAGARI LETTER O -->
             <Key
                 latin:keyLabel="&#x0913;"
@@ -75,10 +91,25 @@
                 latin:moreKeys="&#x093C;"
                 latin:keyLabelFlags="fontNormal" />
             <!-- Because the font rendering system prior to API version 16 can't automatically
-                 render dotted circle for incomplete combining letter of Hindi, different set of
-                 Key definitions are needed based on the API version. -->
+                 render dotted circle for incomplete combining letter of some scripts, different
+                 set of Key definitions are needed based on the API version. -->
+            <!-- U+0968: "२" DEVANAGARI DIGIT TWO -->
+            <include
+                latin:keyboardLayout="@xml/keystyle_devanagari_vowel_sign_au" />
+            <Key
+                latin:keyStyle="baseKeyDevanagariVowelSignAu"
+                latin:keyHintLabel="2"
+                latin:additionalMoreKeys="&#x0968;,2" />
+            <!-- Because the font rendering system prior to API version 16 can't automatically
+                 render dotted circle for incomplete combining letter of some scripts, different
+                 set of Key definitions are needed based on the API version. -->
+            <!-- U+0969: "३" DEVANAGARI DIGIT THREE -->
             <include
-                latin:keyboardLayout="@xml/keys_nepali_romanized1_left2" />
+                latin:keyboardLayout="@xml/keystyle_devanagari_vowel_sign_e" />
+            <Key
+                latin:keyStyle="baseKeyDevanagariVowelSignE"
+                latin:keyHintLabel="3"
+                latin:additionalMoreKeys="&#x0969;,3" />
             <!-- U+0930: "र" DEVANAGARI LETTER RA
                  U+096A: "४" DEVANAGARI DIGIT FOUR -->
             <Key
@@ -101,10 +132,35 @@
                 latin:additionalMoreKeys="&#x096C;,6"
                 latin:keyLabelFlags="fontNormal" />
             <!-- Because the font rendering system prior to API version 16 can't automatically
-                 render dotted circle for incomplete combining letter of Hindi, different set of
-                 Key definitions are needed based on the API version. -->
+                 render dotted circle for incomplete combining letter of some scripts, different
+                 set of Key definitions are needed based on the API version. -->
+            <!-- U+096D: "७" DEVANAGARI DIGIT SEVEN -->
+            <include
+                latin:keyboardLayout="@xml/keystyle_devanagari_vowel_sign_u" />
+            <Key
+                latin:keyStyle="baseKeyDevanagariVowelSignU"
+                latin:keyHintLabel="7"
+                latin:additionalMoreKeys="&#x096D;,7" />
+            <!-- Because the font rendering system prior to API version 16 can't automatically
+                 render dotted circle for incomplete combining letter of some scripts, different
+                 set of Key definitions are needed based on the API version. -->
+            <!-- U+096E: "८" DEVANAGARI DIGIT EIGHT -->
             <include
-                latin:keyboardLayout="@xml/keys_nepali_romanized1_right3" />
+                latin:keyboardLayout="@xml/keystyle_devanagari_vowel_sign_i" />
+            <Key
+                latin:keyStyle="baseKeyDevanagariVowelSignI"
+                latin:keyHintLabel="8"
+                latin:additionalMoreKeys="&#x096E;,8" />
+            <!-- Because the font rendering system prior to API version 16 can't automatically
+                 render dotted circle for incomplete combining letter of some scripts, different
+                 set of Key definitions are needed based on the API version. -->
+            <!-- U+096F: "९" DEVANAGARI DIGIT NINE -->
+            <include
+                latin:keyboardLayout="@xml/keystyle_devanagari_vowel_sign_o" />
+            <Key
+                latin:keyStyle="baseKeyDevanagariVowelSignO"
+                latin:keyHintLabel="9"
+                latin:additionalMoreKeys="&#x096F;,9" />
             <!-- U+092A: "प" DEVANAGARI LETTER PA
                  U+0966: "०" DEVANAGARI DIGIT ZERO -->
             <Key
diff --git a/java/res/xml/rowkeys_nepali_romanized2.xml b/java/res/xml/rowkeys_nepali_romanized2.xml
index fd2e4d098f8827865255dd0671e29e811277c5ec..3b8372c6195f09a2d20a2914d6a419d6762480d7 100644
--- a/java/res/xml/rowkeys_nepali_romanized2.xml
+++ b/java/res/xml/rowkeys_nepali_romanized2.xml
@@ -66,17 +66,19 @@
                 latin:keyLabel="&#x0910;"
                 latin:keyLabelFlags="fontNormal" />
             <!-- Because the font rendering system prior to API version 16 can't automatically
-                 render dotted circle for incomplete combining letter of Hindi, different set of
-                 Key definitions are needed based on the API version. -->
+                 render dotted circle for incomplete combining letter of some scripts, different
+                 set of Key definitions are needed based on the API version. -->
             <include
-                latin:keyboardLayout="@xml/key_nepali_romanized2_shift" />
+                latin:keyboardLayout="@xml/key_devanagari_sign_visarga" />
         </case>
         <default>
             <!-- Because the font rendering system prior to API version 16 can't automatically
-                 render dotted circle for incomplete combining letter of Hindi, different set of
-                 Key definitions are needed based on the API version. -->
+                 render dotted circle for incomplete combining letter of some scripts, different
+                 set of Key definitions are needed based on the API version. -->
             <include
-                latin:keyboardLayout="@xml/key_nepali_romanized2" />
+                latin:keyboardLayout="@xml/keystyle_devanagari_vowel_sign_aa" />
+            <Key
+                latin:keyStyle="baseKeyDevanagariVowelSignAa" />
             <!-- U+0938: "स" DEVANAGARI LETTER SA -->
             <Key
                 latin:keyLabel="&#x0938;"
diff --git a/java/res/xml/rowkeys_nepali_romanized3.xml b/java/res/xml/rowkeys_nepali_romanized3.xml
index bbc0e3afee850825ff6cce24a1afcdc88a620bd4..0425d389058e22c570651b57e8755ab585d9f4f2 100644
--- a/java/res/xml/rowkeys_nepali_romanized3.xml
+++ b/java/res/xml/rowkeys_nepali_romanized3.xml
@@ -38,10 +38,10 @@
                 latin:keyLabel="&#x091B;"
                 latin:keyLabelFlags="fontNormal" />
             <!-- Because the font rendering system prior to API version 16 can't automatically
-                 render dotted circle for incomplete combining letter of Hindi, different set of
-                 Key definitions are needed based on the API version. -->
+                 render dotted circle for incomplete combining letter of some scripts, different
+                 set of Key definitions are needed based on the API version. -->
             <include
-                latin:keyboardLayout="@xml/key_nepali_romanized3_shift_left" />
+                latin:keyboardLayout="@xml/key_devanagari_sign_candrabindu" />
             <!-- U+092D: "भ" DEVANAGARI LETTER BHA -->
             <Key
                 latin:keyLabel="&#x092D;"
@@ -51,19 +51,19 @@
                 latin:keyLabel="&#x0936;"
                 latin:keyLabelFlags="fontNormal" />
             <!-- Because the font rendering system prior to API version 16 can't automatically
-                 render dotted circle for incomplete combining letter of Hindi, different set of
-                 Key definitions are needed based on the API version. -->
+                 render dotted circle for incomplete combining letter of some scripts, different
+                 set of Key definitions are needed based on the API version. -->
             <include
-                latin:keyboardLayout="@xml/key_nepali_romanized3_shift_center" />
+                latin:keyboardLayout="@xml/key_devanagari_sign_anusvara" />
             <!-- U+0919: "ङ" DEVANAGARI LETTER NGA -->
             <Key
                 latin:keyLabel="&#x0919;"
                 latin:keyLabelFlags="fontNormal" />
             <!-- Because the font rendering system prior to API version 16 can't automatically
-                 render dotted circle for incomplete combining letter of Hindi, different set of
-                 Key definitions are needed based on the API version. -->
+                 render dotted circle for incomplete combining letter of some scripts, different
+                 set of Key definitions are needed based on the API version. -->
             <include
-                latin:keyboardLayout="@xml/key_nepali_romanized3_shift_right" />
+                latin:keyboardLayout="@xml/key_devanagari_sign_virama" />
         </case>
         <default>
             <!-- U+0937: "ष" DEVANAGARI LETTER SSA -->
@@ -101,10 +101,10 @@
                 latin:moreKeys="&#x093D;"
                 latin:keyLabelFlags="fontNormal" />
             <!-- Because the font rendering system prior to API version 16 can't automatically
-                 render dotted circle for incomplete combining letter of Hindi, different set of
-                 Key definitions are needed based on the API version. -->
+                 render dotted circle for incomplete combining letter of some scripts, different
+                 set of Key definitions are needed based on the API version. -->
             <include
-                latin:keyboardLayout="@xml/key_nepali_romanized3" />
+                latin:keyboardLayout="@xml/key_devanagari_sign_virama" />
          </default>
     </switch>
 </merge>