diff --git a/java/res/drawable-xlarge/btn_keyboard_key_dark_normal_holo.9.png b/java/res/drawable-xlarge/btn_keyboard_key_dark_normal_holo.9.png
new file mode 100644
index 0000000000000000000000000000000000000000..c23ff187830976462d56a01b509514cc9ea29dab
Binary files /dev/null and b/java/res/drawable-xlarge/btn_keyboard_key_dark_normal_holo.9.png differ
diff --git a/java/res/drawable-xlarge/btn_keyboard_key_dark_normal_off_holo.9.png b/java/res/drawable-xlarge/btn_keyboard_key_dark_normal_off_holo.9.png
new file mode 100644
index 0000000000000000000000000000000000000000..e29de9a7f48892c2b74d58920274d79c2c815fd1
Binary files /dev/null and b/java/res/drawable-xlarge/btn_keyboard_key_dark_normal_off_holo.9.png differ
diff --git a/java/res/drawable-xlarge/btn_keyboard_key_dark_normal_on_holo.9.png b/java/res/drawable-xlarge/btn_keyboard_key_dark_normal_on_holo.9.png
new file mode 100644
index 0000000000000000000000000000000000000000..d46c03aa42e1cd1b15bb27f2e4324f241396fbe8
Binary files /dev/null and b/java/res/drawable-xlarge/btn_keyboard_key_dark_normal_on_holo.9.png differ
diff --git a/java/res/drawable-xlarge/btn_keyboard_key_dark_pressed_holo.9.png b/java/res/drawable-xlarge/btn_keyboard_key_dark_pressed_holo.9.png
new file mode 100644
index 0000000000000000000000000000000000000000..45ca3a7fc4f72093e86b61a571a4d50ab9d7914b
Binary files /dev/null and b/java/res/drawable-xlarge/btn_keyboard_key_dark_pressed_holo.9.png differ
diff --git a/java/res/drawable-xlarge/btn_keyboard_key_dark_pressed_off_holo.9.png b/java/res/drawable-xlarge/btn_keyboard_key_dark_pressed_off_holo.9.png
new file mode 100644
index 0000000000000000000000000000000000000000..da039f3dfc8fca8c510f4f9986e7305b29446dac
Binary files /dev/null and b/java/res/drawable-xlarge/btn_keyboard_key_dark_pressed_off_holo.9.png differ
diff --git a/java/res/drawable-xlarge/btn_keyboard_key_dark_pressed_on_holo.9.png b/java/res/drawable-xlarge/btn_keyboard_key_dark_pressed_on_holo.9.png
new file mode 100644
index 0000000000000000000000000000000000000000..315ab17c07f381787750cf106c0e287e837def40
Binary files /dev/null and b/java/res/drawable-xlarge/btn_keyboard_key_dark_pressed_on_holo.9.png differ
diff --git a/java/res/drawable-xlarge/btn_keyboard_key_gingerbread.xml b/java/res/drawable-xlarge/btn_keyboard_key_gingerbread.xml
new file mode 100644
index 0000000000000000000000000000000000000000..3dab8430f152c386beedebe54efb14fb05db0061
--- /dev/null
+++ b/java/res/drawable-xlarge/btn_keyboard_key_gingerbread.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 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.
+-->
+
+<!-- TODO: Remove "gingerbread" from file name and rename this to "btn_keyboard_key.xml". -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <!-- Functional keys. -->
+
+    <item android:state_single="true" android:state_pressed="true"
+          android:drawable="@drawable/btn_keyboard_key_dark_pressed_holo" />
+    <item android:state_single="true"
+          android:drawable="@drawable/btn_keyboard_key_dark_normal_holo" />
+
+    <!-- Toggle keys. Use checkable/checked state. -->
+
+    <item android:state_checkable="true" android:state_checked="true" android:state_pressed="true"
+          android:drawable="@drawable/btn_keyboard_key_dark_pressed_on_holo" />
+    <item android:state_checkable="true" android:state_pressed="true"
+          android:drawable="@drawable/btn_keyboard_key_dark_pressed_off_holo" />
+    <item android:state_checkable="true" android:state_checked="true"
+          android:drawable="@drawable/btn_keyboard_key_dark_normal_on_holo" />
+    <item android:state_checkable="true"
+          android:drawable="@drawable/btn_keyboard_key_dark_normal_off_holo" />
+
+    <!-- Normal keys -->
+
+    <item android:state_pressed="true"
+          android:drawable="@drawable/btn_keyboard_key_light_pressed_holo" />
+    <item android:drawable="@drawable/btn_keyboard_key_light_normal_holo" />
+</selector>
diff --git a/java/res/drawable-xlarge/btn_keyboard_key_light_normal_holo.9.png b/java/res/drawable-xlarge/btn_keyboard_key_light_normal_holo.9.png
new file mode 100644
index 0000000000000000000000000000000000000000..a1c80a2ed6aa3a9977b420e4d3851cd4ffa6d28e
Binary files /dev/null and b/java/res/drawable-xlarge/btn_keyboard_key_light_normal_holo.9.png differ
diff --git a/java/res/drawable-xlarge/btn_keyboard_key_light_pressed_holo.9.png b/java/res/drawable-xlarge/btn_keyboard_key_light_pressed_holo.9.png
new file mode 100644
index 0000000000000000000000000000000000000000..90babfc876fa206f899bb940a1c8607fbe4e50dc
Binary files /dev/null and b/java/res/drawable-xlarge/btn_keyboard_key_light_pressed_holo.9.png differ
diff --git a/java/res/drawable-xlarge/key_hint_0_holo.9.png b/java/res/drawable-xlarge/key_hint_0_holo.9.png
new file mode 100644
index 0000000000000000000000000000000000000000..33b6b40f381c4aae06bae333ccf3cddee01cf112
Binary files /dev/null and b/java/res/drawable-xlarge/key_hint_0_holo.9.png differ
diff --git a/java/res/drawable-xlarge/key_hint_1_holo.9.png b/java/res/drawable-xlarge/key_hint_1_holo.9.png
new file mode 100644
index 0000000000000000000000000000000000000000..df47e7b7c9643d106393b1a9dcaf2ab9c6f52b59
Binary files /dev/null and b/java/res/drawable-xlarge/key_hint_1_holo.9.png differ
diff --git a/java/res/drawable-xlarge/key_hint_2_holo.9.png b/java/res/drawable-xlarge/key_hint_2_holo.9.png
new file mode 100644
index 0000000000000000000000000000000000000000..bea76f3f28d7a48e66f3b14b369cbde6b0e5b948
Binary files /dev/null and b/java/res/drawable-xlarge/key_hint_2_holo.9.png differ
diff --git a/java/res/drawable-xlarge/key_hint_3_holo.9.png b/java/res/drawable-xlarge/key_hint_3_holo.9.png
new file mode 100644
index 0000000000000000000000000000000000000000..8f8f89d50507bf52deaa0f79cd3bc110453f788c
Binary files /dev/null and b/java/res/drawable-xlarge/key_hint_3_holo.9.png differ
diff --git a/java/res/drawable-xlarge/key_hint_4_holo.9.png b/java/res/drawable-xlarge/key_hint_4_holo.9.png
new file mode 100644
index 0000000000000000000000000000000000000000..feaa88ae1e2ea921ea77e1153eb5c228f243a681
Binary files /dev/null and b/java/res/drawable-xlarge/key_hint_4_holo.9.png differ
diff --git a/java/res/drawable-xlarge/key_hint_5_holo.9.png b/java/res/drawable-xlarge/key_hint_5_holo.9.png
new file mode 100644
index 0000000000000000000000000000000000000000..b3635e01e5dbbc4a8ffb4e0647a794fea9c429ca
Binary files /dev/null and b/java/res/drawable-xlarge/key_hint_5_holo.9.png differ
diff --git a/java/res/drawable-xlarge/key_hint_6_holo.9.png b/java/res/drawable-xlarge/key_hint_6_holo.9.png
new file mode 100644
index 0000000000000000000000000000000000000000..1345980e45539fc524d3414533ace548f5d382fd
Binary files /dev/null and b/java/res/drawable-xlarge/key_hint_6_holo.9.png differ
diff --git a/java/res/drawable-xlarge/key_hint_7_holo.9.png b/java/res/drawable-xlarge/key_hint_7_holo.9.png
new file mode 100644
index 0000000000000000000000000000000000000000..437301012837c3d722817c55090e0bb2d6df7654
Binary files /dev/null and b/java/res/drawable-xlarge/key_hint_7_holo.9.png differ
diff --git a/java/res/drawable-xlarge/key_hint_8_holo.9.png b/java/res/drawable-xlarge/key_hint_8_holo.9.png
new file mode 100644
index 0000000000000000000000000000000000000000..1bde6d10acc13036cbf9511b80493680c65a80cd
Binary files /dev/null and b/java/res/drawable-xlarge/key_hint_8_holo.9.png differ
diff --git a/java/res/drawable-xlarge/key_hint_9_holo.9.png b/java/res/drawable-xlarge/key_hint_9_holo.9.png
new file mode 100644
index 0000000000000000000000000000000000000000..61d6f5518b2ffb38a84ff5ae67daa367bfb097d0
Binary files /dev/null and b/java/res/drawable-xlarge/key_hint_9_holo.9.png differ
diff --git a/java/res/drawable-xlarge/key_hint_at_holo.9.png b/java/res/drawable-xlarge/key_hint_at_holo.9.png
new file mode 100644
index 0000000000000000000000000000000000000000..f422a84d66023730d862096d9f5390ae76c62450
Binary files /dev/null and b/java/res/drawable-xlarge/key_hint_at_holo.9.png differ
diff --git a/java/res/drawable-xlarge/key_hint_colon_holo.9.png b/java/res/drawable-xlarge/key_hint_colon_holo.9.png
new file mode 100644
index 0000000000000000000000000000000000000000..7c769bd9794e7675c214947c5da7bd692760d32a
Binary files /dev/null and b/java/res/drawable-xlarge/key_hint_colon_holo.9.png differ
diff --git a/java/res/drawable-xlarge/key_hint_comma_holo.9.png b/java/res/drawable-xlarge/key_hint_comma_holo.9.png
new file mode 100644
index 0000000000000000000000000000000000000000..a9689adf5f024d6691d2558d6aecdbe7b17539f7
Binary files /dev/null and b/java/res/drawable-xlarge/key_hint_comma_holo.9.png differ
diff --git a/java/res/drawable-xlarge/key_hint_dash_holo.9.png b/java/res/drawable-xlarge/key_hint_dash_holo.9.png
new file mode 100644
index 0000000000000000000000000000000000000000..2402994f0f02426d187a5a78d42e82b5127099ee
Binary files /dev/null and b/java/res/drawable-xlarge/key_hint_dash_holo.9.png differ
diff --git a/java/res/drawable-xlarge/key_hint_equal_holo.9.png b/java/res/drawable-xlarge/key_hint_equal_holo.9.png
new file mode 100644
index 0000000000000000000000000000000000000000..89e5084185c30fa498fa8028f545fa7e392d3fc8
Binary files /dev/null and b/java/res/drawable-xlarge/key_hint_equal_holo.9.png differ
diff --git a/java/res/drawable-xlarge/key_hint_exclamation_holo.9.png b/java/res/drawable-xlarge/key_hint_exclamation_holo.9.png
new file mode 100644
index 0000000000000000000000000000000000000000..f349538182a67daf562749767b2705a3a6538b91
Binary files /dev/null and b/java/res/drawable-xlarge/key_hint_exclamation_holo.9.png differ
diff --git a/java/res/drawable-xlarge/key_hint_larger_holo.9.png b/java/res/drawable-xlarge/key_hint_larger_holo.9.png
new file mode 100644
index 0000000000000000000000000000000000000000..2d734369a2539c540ff22111f46c14e6e86b58a9
Binary files /dev/null and b/java/res/drawable-xlarge/key_hint_larger_holo.9.png differ
diff --git a/java/res/drawable-xlarge/key_hint_parenclose_holo.9.png b/java/res/drawable-xlarge/key_hint_parenclose_holo.9.png
new file mode 100644
index 0000000000000000000000000000000000000000..48f9f80655ec4cbe1a18d1fdcd3eda819f09e6ca
Binary files /dev/null and b/java/res/drawable-xlarge/key_hint_parenclose_holo.9.png differ
diff --git a/java/res/drawable-xlarge/key_hint_parenopen_holo.9.png b/java/res/drawable-xlarge/key_hint_parenopen_holo.9.png
new file mode 100644
index 0000000000000000000000000000000000000000..f05ae207577c582a1095bc3c5b316083feb37607
Binary files /dev/null and b/java/res/drawable-xlarge/key_hint_parenopen_holo.9.png differ
diff --git a/java/res/drawable-xlarge/key_hint_period_holo.9.png b/java/res/drawable-xlarge/key_hint_period_holo.9.png
new file mode 100644
index 0000000000000000000000000000000000000000..ec330fb6e5fa750eeaa2448ef725ce7bea81d1e4
Binary files /dev/null and b/java/res/drawable-xlarge/key_hint_period_holo.9.png differ
diff --git a/java/res/drawable-xlarge/key_hint_plus_holo.9.png b/java/res/drawable-xlarge/key_hint_plus_holo.9.png
new file mode 100644
index 0000000000000000000000000000000000000000..770bf5dbea3c7f407bab806a7e3944a3eb792308
Binary files /dev/null and b/java/res/drawable-xlarge/key_hint_plus_holo.9.png differ
diff --git a/java/res/drawable-xlarge/key_hint_question_holo.9.png b/java/res/drawable-xlarge/key_hint_question_holo.9.png
new file mode 100644
index 0000000000000000000000000000000000000000..f24bb1c090fb01cdf803c1526ae0cdcf8637520a
Binary files /dev/null and b/java/res/drawable-xlarge/key_hint_question_holo.9.png differ
diff --git a/java/res/drawable-xlarge/key_hint_quote_holo.9.png b/java/res/drawable-xlarge/key_hint_quote_holo.9.png
new file mode 100644
index 0000000000000000000000000000000000000000..ceee67ddcbd250c1abc82552318022cb481101f2
Binary files /dev/null and b/java/res/drawable-xlarge/key_hint_quote_holo.9.png differ
diff --git a/java/res/drawable-xlarge/key_hint_semicolon_holo.9.png b/java/res/drawable-xlarge/key_hint_semicolon_holo.9.png
new file mode 100644
index 0000000000000000000000000000000000000000..e8d6b022390bc4cb9b0e65e1e4eec094d72ef4ca
Binary files /dev/null and b/java/res/drawable-xlarge/key_hint_semicolon_holo.9.png differ
diff --git a/java/res/drawable-xlarge/key_hint_simplequote_holo.9.png b/java/res/drawable-xlarge/key_hint_simplequote_holo.9.png
new file mode 100644
index 0000000000000000000000000000000000000000..7cafbb0d49a008965c42beb571589bfe9df8d343
Binary files /dev/null and b/java/res/drawable-xlarge/key_hint_simplequote_holo.9.png differ
diff --git a/java/res/drawable-xlarge/key_hint_slash_holo.9.png b/java/res/drawable-xlarge/key_hint_slash_holo.9.png
new file mode 100644
index 0000000000000000000000000000000000000000..676d5669820c9532e1718f931a06ad88e8d6a0d7
Binary files /dev/null and b/java/res/drawable-xlarge/key_hint_slash_holo.9.png differ
diff --git a/java/res/drawable-xlarge/key_hint_smaller_holo.9.png b/java/res/drawable-xlarge/key_hint_smaller_holo.9.png
new file mode 100644
index 0000000000000000000000000000000000000000..97cf26edc241670651a0737166d81c368fd406fc
Binary files /dev/null and b/java/res/drawable-xlarge/key_hint_smaller_holo.9.png differ
diff --git a/java/res/drawable-xlarge/key_hint_star_holo.9.png b/java/res/drawable-xlarge/key_hint_star_holo.9.png
new file mode 100644
index 0000000000000000000000000000000000000000..b10aa89bda3df58893a4ad2c876a4d6362cee646
Binary files /dev/null and b/java/res/drawable-xlarge/key_hint_star_holo.9.png differ
diff --git a/java/res/drawable-xlarge/key_hint_underline_holo.9.png b/java/res/drawable-xlarge/key_hint_underline_holo.9.png
new file mode 100644
index 0000000000000000000000000000000000000000..38abfcb0152d863a8e0de3938e2e771aae992457
Binary files /dev/null and b/java/res/drawable-xlarge/key_hint_underline_holo.9.png differ
diff --git a/java/res/values-xlarge/dimens.xml b/java/res/values-xlarge/dimens.xml
index d2cd6c7d1532646431f908ca8dc21389fe16a82e..4614f720a401df235c899be1b7b0d54173f585f4 100644
--- a/java/res/values-xlarge/dimens.xml
+++ b/java/res/values-xlarge/dimens.xml
@@ -21,7 +21,8 @@
 <resources>
     <!-- key_height + key_bottom_gap = popup_key_height -->
     <dimen name="key_height">0.450in</dimen>
-    <dimen name="key_bottom_gap">0.0in</dimen>
+    <dimen name="key_bottom_gap">0.03in</dimen>
+    <dimen name="key_horizontal_gap">0.03in</dimen>
     <dimen name="popup_key_height">0.450in</dimen>
     <dimen name="keyboard_bottom_padding">0.10in</dimen>
     <!-- key_height x 1.6 -->
diff --git a/java/res/values/dimens.xml b/java/res/values/dimens.xml
index 2fa47ae5290cb11a9088342b3541a62562e423a5..765262d56f94703ef0db4c8939e01e1b90e96596 100644
--- a/java/res/values/dimens.xml
+++ b/java/res/values/dimens.xml
@@ -22,6 +22,7 @@
     <!-- key_height + key_bottom_gap = popup_key_height -->
     <dimen name="key_height">0.290in</dimen>
     <dimen name="key_bottom_gap">0.035in</dimen>
+    <dimen name="key_horizontal_gap">0.000in</dimen>
     <dimen name="popup_key_height">0.325in</dimen>
     <dimen name="keyboard_bottom_padding">0.06in</dimen>
     <!-- key_height x 1.6 -->
diff --git a/java/res/xml-da/kbd_qwerty.xml b/java/res/xml-da/kbd_qwerty.xml
index 66771c28752e19632763e67638375d9158678e6a..f1f9904e393c4e315eb7543db0c07d30df0a2678 100644
--- a/java/res/xml-da/kbd_qwerty.xml
+++ b/java/res/xml-da/kbd_qwerty.xml
@@ -27,7 +27,7 @@
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
     latin:keyWidth="9.09%p"
-    latin:horizontalGap="0px"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
     latin:verticalGap="@dimen/key_bottom_gap"
     latin:keyHeight="@dimen/key_height"
 >
diff --git a/java/res/xml-da/kbd_qwerty_black.xml b/java/res/xml-da/kbd_qwerty_black.xml
index d89204ae64f9c21db5110b401b5d9b3683ae5b6c..b7ebc66def190879762e67d3aa9a3125e299bd84 100644
--- a/java/res/xml-da/kbd_qwerty_black.xml
+++ b/java/res/xml-da/kbd_qwerty_black.xml
@@ -27,7 +27,7 @@
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
     latin:keyWidth="9.09%p"
-    latin:horizontalGap="0px"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
     latin:verticalGap="@dimen/key_bottom_gap"
     latin:keyHeight="@dimen/key_height"
 >
diff --git a/java/res/xml-de/kbd_qwerty.xml b/java/res/xml-de/kbd_qwerty.xml
index 30d8de0cffc22d5feef6a8b566d235becad2712f..0832cbc92243a5ccd9fd6cc9b92393b3035b5e3c 100644
--- a/java/res/xml-de/kbd_qwerty.xml
+++ b/java/res/xml-de/kbd_qwerty.xml
@@ -21,7 +21,7 @@
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
     latin:keyWidth="10%p"
-    latin:horizontalGap="0px"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
     latin:verticalGap="@dimen/key_bottom_gap"
     latin:keyHeight="@dimen/key_height"
 >
@@ -82,11 +82,12 @@
             latin:keyEdgeFlags="right" />
     </Row>
     <Row>
+        <Spacer
+            latin:horizontalGap="5%p" />
         <Key
             latin:keyLabel="a"
             latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_a"
-            latin:horizontalGap="5%p"
             latin:keyEdgeFlags="left" />
         <Key
             latin:keyLabel="s"
diff --git a/java/res/xml-de/kbd_qwerty_black.xml b/java/res/xml-de/kbd_qwerty_black.xml
index f394c8d02f96e1dc2d31f886b73c170dc1257cc7..13a7dcb79f2723136bbe426a924358bc57c3b2aa 100644
--- a/java/res/xml-de/kbd_qwerty_black.xml
+++ b/java/res/xml-de/kbd_qwerty_black.xml
@@ -21,7 +21,7 @@
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
     latin:keyWidth="10%p"
-    latin:horizontalGap="0px"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
     latin:verticalGap="@dimen/key_bottom_gap"
     latin:keyHeight="@dimen/key_height"
 >
@@ -82,11 +82,12 @@
             latin:keyEdgeFlags="right" />
     </Row>
     <Row>
+        <Spacer
+            latin:horizontalGap="5%p" />
         <Key
             latin:keyLabel="a"
             latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_a"
-            latin:horizontalGap="5%p"
             latin:keyEdgeFlags="left" />
         <Key
             latin:keyLabel="s"
diff --git a/java/res/xml-fr/kbd_qwerty.xml b/java/res/xml-fr/kbd_qwerty.xml
index 9a4a8796bab91bd258cc5ded4e3b5f49ece09ae4..95c1073824e1fcd089cce7234ca69e48d3fcd84a 100644
--- a/java/res/xml-fr/kbd_qwerty.xml
+++ b/java/res/xml-fr/kbd_qwerty.xml
@@ -21,7 +21,7 @@
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
     latin:keyWidth="10%p"
-    latin:horizontalGap="0px"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
     latin:verticalGap="@dimen/key_bottom_gap"
     latin:keyHeight="@dimen/key_height"
 >
diff --git a/java/res/xml-fr/kbd_qwerty_black.xml b/java/res/xml-fr/kbd_qwerty_black.xml
index be2befbe8f07e21540e9571e0f90b192febcfb2a..b46ce9cb9650b2d579b6fec2dc1b2ae52c91b9c1 100644
--- a/java/res/xml-fr/kbd_qwerty_black.xml
+++ b/java/res/xml-fr/kbd_qwerty_black.xml
@@ -21,7 +21,7 @@
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
     latin:keyWidth="10%p"
-    latin:horizontalGap="0px"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
     latin:verticalGap="@dimen/key_bottom_gap"
     latin:keyHeight="@dimen/key_height"
 >
diff --git a/java/res/xml-iw/kbd_qwerty.xml b/java/res/xml-iw/kbd_qwerty.xml
index 7f66eef5698437d959344c8f70250dc909a0f4f2..fd94a12026a62132ebc9a62378f42ccea9636dd2 100644
--- a/java/res/xml-iw/kbd_qwerty.xml
+++ b/java/res/xml-iw/kbd_qwerty.xml
@@ -21,16 +21,17 @@
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
     latin:keyWidth="10%p"
-    latin:horizontalGap="0px"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
     latin:verticalGap="@dimen/key_bottom_gap"
     latin:keyHeight="@dimen/key_height"
 >
     <Row
         latin:rowEdgeFlags="top"
     >
+        <Spacer
+            latin:horizontalGap="5%p" />
         <Key
             latin:keyLabel="×§"
-            latin:horizontalGap="5%p"
             latin:keyEdgeFlags="left" />
         <Key
             latin:keyLabel="ר" />
@@ -46,13 +47,14 @@
             latin:keyLabel="ם" />
         <Key
             latin:keyLabel="פ" />
+        <Spacer
+            latin:horizontalGap="1.25%p" />
         <Key
             latin:codes="@integer/key_delete"
             latin:keyIcon="@drawable/sym_keyboard_delete"
             latin:iconPreview="@drawable/sym_keyboard_feedback_delete"
             latin:keyWidth="13.75%p"
             latin:isModifier="true"
-            latin:horizontalGap="1.25%p"
             latin:isRepeatable="true"
             latin:keyEdgeFlags="right" />
     </Row>
@@ -81,9 +83,10 @@
             latin:keyEdgeFlags="right" />
     </Row>
     <Row>
+        <Spacer
+            latin:horizontalGap="5%p" />
         <Key
             latin:keyLabel="×–"
-            latin:horizontalGap="5%p"
             latin:keyEdgeFlags="left" />
         <Key
             latin:keyLabel="ס" />
diff --git a/java/res/xml-iw/kbd_qwerty_black.xml b/java/res/xml-iw/kbd_qwerty_black.xml
index 80ade2020ac6da5e895ee57a5124e2ec0e932fd1..1c1c1e37fc9b80d4677514905cabb6171864adba 100644
--- a/java/res/xml-iw/kbd_qwerty_black.xml
+++ b/java/res/xml-iw/kbd_qwerty_black.xml
@@ -21,16 +21,17 @@
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
     latin:keyWidth="10%p"
-    latin:horizontalGap="0px"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
     latin:verticalGap="@dimen/key_bottom_gap"
     latin:keyHeight="@dimen/key_height"
 >
     <Row
         latin:rowEdgeFlags="top"
     >
+        <Spacer
+            latin:horizontalGap="5%p" />
         <Key
             latin:keyLabel="×§"
-            latin:horizontalGap="5%p"
             latin:keyEdgeFlags="left" />
         <Key
             latin:keyLabel="ר" />
@@ -46,12 +47,13 @@
             latin:keyLabel="ם" />
         <Key
             latin:keyLabel="פ" />
+        <Spacer
+            latin:horizontalGap="1.25%p" />
         <Key
             latin:codes="@integer/key_delete"
             latin:keyIcon="@drawable/sym_bkeyboard_delete"
             latin:iconPreview="@drawable/sym_keyboard_feedback_delete"
             latin:keyWidth="13.75%p"
-            latin:horizontalGap="1.25%p"
             latin:isRepeatable="true"
             latin:keyEdgeFlags="right" />
     </Row>
@@ -80,9 +82,10 @@
             latin:keyEdgeFlags="right" />
     </Row>
     <Row>
+        <Spacer
+            latin:horizontalGap="5%p" />
         <Key
             latin:keyLabel="×–"
-            latin:horizontalGap="5%p"
             latin:keyEdgeFlags="left" />
         <Key
             latin:keyLabel="ס" />
diff --git a/java/res/xml-nb/kbd_qwerty.xml b/java/res/xml-nb/kbd_qwerty.xml
index 96a86b0130a147e97f3c5d39595cc24965e3b6a8..32512daaaf94e810989b6338efc1bf907cabd867 100644
--- a/java/res/xml-nb/kbd_qwerty.xml
+++ b/java/res/xml-nb/kbd_qwerty.xml
@@ -27,7 +27,7 @@
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
     latin:keyWidth="9.09%p"
-    latin:horizontalGap="0px"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
     latin:verticalGap="@dimen/key_bottom_gap"
     latin:keyHeight="@dimen/key_height"
 >
diff --git a/java/res/xml-nb/kbd_qwerty_black.xml b/java/res/xml-nb/kbd_qwerty_black.xml
index 4adeb480160e0d25da25aae88be6bd7c7bef59db..982a3de651339bfe2c6cc4c0e8d11d5a5b9060a8 100644
--- a/java/res/xml-nb/kbd_qwerty_black.xml
+++ b/java/res/xml-nb/kbd_qwerty_black.xml
@@ -27,7 +27,7 @@
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
     latin:keyWidth="9.09%p"
-    latin:horizontalGap="0px"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
     latin:verticalGap="@dimen/key_bottom_gap"
     latin:keyHeight="@dimen/key_height"
 >
diff --git a/java/res/xml-ru/kbd_qwerty.xml b/java/res/xml-ru/kbd_qwerty.xml
index 57114a8ea610148ce6b5ad425e301e74c0c7634c..80a9ddd4f15aed522276c8ea4deefbca059a3d64 100644
--- a/java/res/xml-ru/kbd_qwerty.xml
+++ b/java/res/xml-ru/kbd_qwerty.xml
@@ -20,8 +20,8 @@
 
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
-    latin:keyWidth="9.09%p"
-    latin:horizontalGap="0px"
+    latin:keyWidth="9.091%p"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
     latin:verticalGap="@dimen/key_bottom_gap"
     latin:keyHeight="@dimen/key_height"
 >
diff --git a/java/res/xml-ru/kbd_qwerty_black.xml b/java/res/xml-ru/kbd_qwerty_black.xml
index 8f2f599c3ef890df3ebcd045771ac21637434245..2635541e8b9bc494d28f846d0ab2fb505cd46805 100644
--- a/java/res/xml-ru/kbd_qwerty_black.xml
+++ b/java/res/xml-ru/kbd_qwerty_black.xml
@@ -21,7 +21,7 @@
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
     latin:keyWidth="9.09%p"
-    latin:horizontalGap="0px"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
     latin:verticalGap="@dimen/key_bottom_gap"
     latin:keyHeight="@dimen/key_height"
 >
diff --git a/java/res/xml-sr/kbd_qwerty.xml b/java/res/xml-sr/kbd_qwerty.xml
index 1a657055a643112ac70ccff942e258ed74e678bf..c9a4e449cffbc5ae7db4861c6e86acdff67f935f 100644
--- a/java/res/xml-sr/kbd_qwerty.xml
+++ b/java/res/xml-sr/kbd_qwerty.xml
@@ -22,7 +22,7 @@
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
     latin:keyWidth="9.09%p"
-    latin:horizontalGap="0px"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
     latin:verticalGap="@dimen/key_bottom_gap"
     latin:keyHeight="@dimen/key_height"
 >
diff --git a/java/res/xml-sr/kbd_qwerty_black.xml b/java/res/xml-sr/kbd_qwerty_black.xml
index e4b09c71702662b379556f9dd3290a41ff478c8f..f760c5eb136d2736adb36f5620d8ec2caa8905ea 100644
--- a/java/res/xml-sr/kbd_qwerty_black.xml
+++ b/java/res/xml-sr/kbd_qwerty_black.xml
@@ -22,7 +22,7 @@
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
     latin:keyWidth="9.09%p"
-    latin:horizontalGap="0px"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
     latin:verticalGap="@dimen/key_bottom_gap"
     latin:keyHeight="@dimen/key_height"
 >
diff --git a/java/res/xml-sv/kbd_qwerty.xml b/java/res/xml-sv/kbd_qwerty.xml
index 8819159e85a4db6e307583e237a3f96fde06fd90..ae7002463b048617e99967970e0ddee98a3d9893 100644
--- a/java/res/xml-sv/kbd_qwerty.xml
+++ b/java/res/xml-sv/kbd_qwerty.xml
@@ -29,7 +29,7 @@
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
     latin:keyWidth="9.09%p"
-    latin:horizontalGap="0px"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
     latin:verticalGap="@dimen/key_bottom_gap"
     latin:keyHeight="@dimen/key_height"
 >
diff --git a/java/res/xml-sv/kbd_qwerty_black.xml b/java/res/xml-sv/kbd_qwerty_black.xml
index 2532fca8cf0e885ee4fd34cc47408a2768c0b32a..463b60bd9ac9600aaa7e1dbb91d30c7fc44788a1 100644
--- a/java/res/xml-sv/kbd_qwerty_black.xml
+++ b/java/res/xml-sv/kbd_qwerty_black.xml
@@ -29,7 +29,7 @@
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
     latin:keyWidth="9.09%p"
-    latin:horizontalGap="0px"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
     latin:verticalGap="@dimen/key_bottom_gap"
     latin:keyHeight="@dimen/key_height"
 >
diff --git a/java/res/xml-xlarge/kbd_phone.xml b/java/res/xml-xlarge/kbd_phone.xml
index 977bbf2df203ae2cf6186ea0ad5012ef1eb61e28..107731f3b0a6628ce4f446908e2339ac76b013e8 100644
--- a/java/res/xml-xlarge/kbd_phone.xml
+++ b/java/res/xml-xlarge/kbd_phone.xml
@@ -21,8 +21,8 @@
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
     latin:keyWidth="7.5%p"
-    latin:horizontalGap="0px"
-    latin:verticalGap="0px"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
+    latin:verticalGap="@dimen/key_bottom_gap"
     latin:keyHeight="@dimen/key_height"
 >
     <!-- This row is intentionally not marked as a top row -->
@@ -35,29 +35,35 @@
             latin:keyEdgeFlags="left" />
         <!-- To match one character label size with "Tab", I placed spaces around the char '-'
              and '+'. -->
+        <Spacer
+            latin:horizontalGap="6.0%p" />
         <Key
             latin:codes="45"
-            latin:keyLabel=" - "
-            latin:horizontalGap="6.0%p" />
+            latin:keyLabel=" - " />
         <Key
             latin:codes="43"
             latin:keyLabel=" + " />
+        <Spacer
+            latin:horizontalGap="11.5%p" />
         <Key
             latin:codes="49"
             latin:keyIcon="@drawable/sym_keyboard_num1"
-            latin:horizontalGap="11.5%p" />
+            latin:keyWidth="10.5%p " />
         <Key
             latin:codes="50"
-            latin:keyIcon="@drawable/sym_keyboard_num2" />
+            latin:keyIcon="@drawable/sym_keyboard_num2"
+            latin:keyWidth="10.5%p " />
         <Key
             latin:codes="51"
-            latin:keyIcon="@drawable/sym_keyboard_num3" />
+            latin:keyIcon="@drawable/sym_keyboard_num3"
+            latin:keyWidth="10.5%p " />
+        <Spacer
+            latin:horizontalGap="6.0%p" />
         <Key
             latin:codes="@integer/key_delete"
             latin:keyIcon="@drawable/sym_keyboard_delete"
             latin:iconPreview="@drawable/sym_keyboard_feedback_delete"
             latin:keyWidth="15.0%p"
-            latin:horizontalGap="6.0%p"
             latin:isModifier="true"
             latin:isRepeatable="true"
             latin:keyEdgeFlags="right" />
@@ -72,29 +78,35 @@
             latin:keyEdgeFlags="left" />
         <!-- To match one character label size with "More", I placed spaces around the char ','
              and '.'. -->
+        <Spacer
+            latin:horizontalGap="6.0%p" />
         <Key
             latin:codes="44"
-            latin:keyLabel=" , "
-            latin:horizontalGap="6.0%p" />
+            latin:keyLabel=" , " />
         <Key
             latin:codes="46"
             latin:keyLabel=" . " />
+        <Spacer
+            latin:horizontalGap="11.5%p" />
         <Key
             latin:codes="52"
             latin:keyIcon="@drawable/sym_keyboard_num4"
-            latin:horizontalGap="11.5%p" />
+            latin:keyWidth="10.5%p " />
         <Key
             latin:codes="53"
-            latin:keyIcon="@drawable/sym_keyboard_num5" />
+            latin:keyIcon="@drawable/sym_keyboard_num5"
+            latin:keyWidth="10.5%p " />
         <Key
             latin:codes="54"
-            latin:keyIcon="@drawable/sym_keyboard_num6" />
+            latin:keyIcon="@drawable/sym_keyboard_num6"
+            latin:keyWidth="10.5%p " />
+        <Spacer
+            latin:horizontalGap="6.0%p" />
         <Key
             latin:codes="@integer/key_return"
             latin:keyIcon="@drawable/sym_keyboard_return"
             latin:iconPreview="@drawable/sym_keyboard_feedback_return"
             latin:keyWidth="15.0%p"
-            latin:horizontalGap="6.0%p"
             latin:isModifier="true"
             latin:keyEdgeFlags="right" />
     </Row>
@@ -103,47 +115,57 @@
              and ')'. -->
         <!-- There is an empty area bellow the "More" key and left of the "(" key.  To ignore
              the touch event on the area, "(" is intentionally not marked as a left edge key. -->
+        <Spacer
+            latin:horizontalGap="21.0%p" />
         <Key
             latin:codes="40"
-            latin:keyLabel=" ( "
-            latin:horizontalGap="21.0%p" />
+            latin:keyLabel=" ( " />
         <Key
             latin:codes="41"
             latin:keyLabel=" ) " />
+        <Spacer
+            latin:horizontalGap="11.5%p" />
         <Key
             latin:codes="55"
             latin:keyIcon="@drawable/sym_keyboard_num7"
-            latin:horizontalGap="11.5%p" />
+            latin:keyWidth="10.5%p " />
         <Key
             latin:codes="56"
-            latin:keyIcon="@drawable/sym_keyboard_num8" />
-        <!-- There is an empty area bellow the "Enter" key and right of the "9" key.  To ignore
-             the touch event on the area, "9" is intentionally not marked as a right edge key. -->
+            latin:keyIcon="@drawable/sym_keyboard_num8"
+            latin:keyWidth="10.5%p " />
         <Key
             latin:codes="57"
-            latin:keyIcon="@drawable/sym_keyboard_num9" />
-    </Row>
+            latin:keyIcon="@drawable/sym_keyboard_num9"
+            latin:keyWidth="10.5%p " />
+        <!-- There is an empty area bellow the "Enter" key and right of the "9" key.  To ignore
+             the touch event on the area, "9" is intentionally not marked as a right edge key. -->
+        </Row>
     <!-- This row is intentionally not marked as a bottom row -->
     <Row>
         <!-- There is an empty area bellow the "More" key and left of the "space" key.  To ignore
              the touch event on the area, "space" is intentionally not marked as a left edge key. -->
+        <Spacer
+            latin:horizontalGap="21.0%p" />
         <Key
             latin:codes="@integer/key_space"
             latin:keyIcon="@drawable/sym_keyboard_space"
             latin:iconPreview="@drawable/sym_keyboard_feedback_space"
-            latin:keyWidth="15.0%p"
-            latin:horizontalGap="21.0%p " />
+            latin:keyWidth="15.0%p" />
+        <Spacer
+            latin:horizontalGap="11.5%p" />
         <Key
             latin:codes="42"
             latin:keyIcon="@drawable/sym_keyboard_numstar"
-            latin:horizontalGap="11.5%p" />
+            latin:keyWidth="10.5%p " />
         <Key
             latin:codes="48"
-            latin:keyIcon="@drawable/sym_keyboard_num0" />
-        <!-- There is an empty area bellow the "Enter" key and right of the "#" key.  To ignore
-             the touch event on the area, "#" is intentionally not marked as a right edge key. -->
+            latin:keyIcon="@drawable/sym_keyboard_num0"
+            latin:keyWidth="10.5%p " />
         <Key
             latin:codes="35"
-            latin:keyIcon="@drawable/sym_keyboard_numpound" />
+            latin:keyIcon="@drawable/sym_keyboard_numpound"
+            latin:keyWidth="10.5%p " />
+        <!-- There is an empty area bellow the "Enter" key and right of the "#" key.  To ignore
+             the touch event on the area, "#" is intentionally not marked as a right edge key. -->
     </Row>
 </Keyboard>
diff --git a/java/res/xml-xlarge/kbd_phone_symbols.xml b/java/res/xml-xlarge/kbd_phone_symbols.xml
index 6fbf3a902cfa5a14c9d56293bd6403e4a066fe98..a7dcd325a6f5e857d77df67912278212bd499dc4 100644
--- a/java/res/xml-xlarge/kbd_phone_symbols.xml
+++ b/java/res/xml-xlarge/kbd_phone_symbols.xml
@@ -21,8 +21,8 @@
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
     latin:keyWidth="7.5%p"
-    latin:horizontalGap="0px"
-    latin:verticalGap="0px"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
+    latin:verticalGap="@dimen/key_bottom_gap"
     latin:keyHeight="@dimen/key_height"
 >
     <!-- This row is intentionally not marked as a top row -->
@@ -33,10 +33,11 @@
             latin:keyWidth="15.0%p"
             latin:isModifier="true"
             latin:keyEdgeFlags="left" />
+        <Spacer
+            latin:horizontalGap="4.0%p" />
         <Key
             latin:codes="44"
-            latin:keyLabel="@string/label_pause_key"
-            latin:horizontalGap="4.0%p" />
+            latin:keyLabel="@string/label_pause_key" />
         <!-- To match one character label size with "Tab" and "Pause, I placed spaces around the
              char '-' and '+'. -->
         <Key
@@ -45,22 +46,27 @@
         <Key
             latin:codes="43"
             latin:keyLabel=" + " />
+        <Spacer
+            latin:horizontalGap="6.0%p" />
         <Key
             latin:codes="49"
             latin:keyIcon="@drawable/sym_keyboard_num1"
-            latin:horizontalGap="6.0%p" />
+            latin:keyWidth="10.5%p " />
         <Key
             latin:codes="50"
-            latin:keyIcon="@drawable/sym_keyboard_num2" />
+            latin:keyIcon="@drawable/sym_keyboard_num2"
+            latin:keyWidth="10.5%p " />
         <Key
             latin:codes="51"
-            latin:keyIcon="@drawable/sym_keyboard_num3" />
+            latin:keyIcon="@drawable/sym_keyboard_num3"
+            latin:keyWidth="10.5%p " />
+        <Spacer
+            latin:horizontalGap="6.0%p" />
         <Key
             latin:codes="@integer/key_delete"
             latin:keyIcon="@drawable/sym_keyboard_delete"
             latin:iconPreview="@drawable/sym_keyboard_feedback_delete"
             latin:keyWidth="15.0%p"
-            latin:horizontalGap="6.0%p"
             latin:isModifier="true"
             latin:isRepeatable="true"
             latin:keyEdgeFlags="right" />
@@ -73,10 +79,11 @@
             latin:isModifier="true"
             latin:isSticky="true"
             latin:keyEdgeFlags="left" />
+        <Spacer
+            latin:horizontalGap="4.0%p" />
         <Key
             latin:codes="59"
-            latin:keyLabel="@string/label_wait_key"
-            latin:horizontalGap="4.0%p" />
+            latin:keyLabel="@string/label_wait_key" />
         <!-- To match one character label size with "More" and "Wait", I placed spaces around the
              char ',' and '.'. -->
         <Key
@@ -85,22 +92,27 @@
         <Key
             latin:codes="46"
             latin:keyLabel=" . " />
+        <Spacer
+            latin:horizontalGap="6.0%p" />
         <Key
             latin:codes="52"
             latin:keyIcon="@drawable/sym_keyboard_num4"
-            latin:horizontalGap="6.0%p" />
+            latin:keyWidth="10.5%p " />
         <Key
             latin:codes="53"
-            latin:keyIcon="@drawable/sym_keyboard_num5" />
+            latin:keyIcon="@drawable/sym_keyboard_num5"
+            latin:keyWidth="10.5%p " />
         <Key
             latin:codes="54"
-            latin:keyIcon="@drawable/sym_keyboard_num6" />
+            latin:keyIcon="@drawable/sym_keyboard_num6"
+            latin:keyWidth="10.5%p " />
+        <Spacer
+            latin:horizontalGap="6.0%p" />
         <Key
             latin:codes="@integer/key_return"
             latin:keyIcon="@drawable/sym_keyboard_return"
             latin:iconPreview="@drawable/sym_keyboard_feedback_return"
             latin:keyWidth="15.0%p"
-            latin:horizontalGap="6.0%p"
             latin:isModifier="true"
             latin:keyEdgeFlags="right" />
     </Row>
@@ -109,50 +121,60 @@
              char 'N', '(' and ')'. -->
         <!-- There is an empty area bellow the "More" key and left of the "(" key.  To ignore
              the touch event on the area, "(" is intentionally not marked as a left edge key. -->
+        <Spacer
+            latin:horizontalGap="19.0%p" />
         <Key
             latin:codes="78"
-            latin:keyLabel=" N "
-            latin:horizontalGap="19.0%p" />
+            latin:keyLabel=" N " />
         <Key
             latin:codes="40"
             latin:keyLabel=" ( " />
         <Key
             latin:codes="41"
             latin:keyLabel=" ) " />
+        <Spacer
+            latin:horizontalGap="6.0%p" />
         <Key
             latin:codes="55"
             latin:keyIcon="@drawable/sym_keyboard_num7"
-            latin:horizontalGap="6.0%p" />
+            latin:keyWidth="10.5%p " />
         <Key
             latin:codes="56"
-            latin:keyIcon="@drawable/sym_keyboard_num8" />
-        <!-- There is an empty area bellow the "Enter" key and right of the "9" key.  To ignore
-             the touch event on the area, "9" is intentionally not marked as a right edge key. -->
+            latin:keyIcon="@drawable/sym_keyboard_num8"
+            latin:keyWidth="10.5%p " />
         <Key
             latin:codes="57"
-            latin:keyIcon="@drawable/sym_keyboard_num9" />
+            latin:keyIcon="@drawable/sym_keyboard_num9"
+            latin:keyWidth="10.5%p " />
+        <!-- There is an empty area bellow the "Enter" key and right of the "9" key.  To ignore
+             the touch event on the area, "9" is intentionally not marked as a right edge key. -->
     </Row>
     <!-- This row is intentionally not marked as a bottom row -->
     <Row>
         <!-- There is an empty area bellow the "More" key and left of the "space" key.  To ignore
              the touch event on the area, "space" is intentionally not marked as a left edge key. -->
+        <Spacer
+            latin:horizontalGap="19.0%p" />
         <Key
             latin:codes="@integer/key_space"
             latin:keyIcon="@drawable/sym_keyboard_space"
             latin:iconPreview="@drawable/sym_keyboard_feedback_space"
-            latin:keyWidth="22.5%p"
-            latin:horizontalGap="19.0%p " />
+            latin:keyWidth="22.5%p" />
+        <Spacer
+            latin:horizontalGap="6.0%p" />
         <Key
             latin:codes="42"
             latin:keyIcon="@drawable/sym_keyboard_numstar"
-            latin:horizontalGap="6.0%p" />
+            latin:keyWidth="10.5%p " />
         <Key
             latin:codes="48"
-            latin:keyIcon="@drawable/sym_keyboard_num0" />
-        <!-- There is an empty area bellow the "Enter" key and right of the "#" key.  To ignore
-             the touch event on the area, "#" is intentionally not marked as a right edge key. -->
+            latin:keyIcon="@drawable/sym_keyboard_num0"
+            latin:keyWidth="10.5%p " />
         <Key
             latin:codes="35"
-            latin:keyIcon="@drawable/sym_keyboard_numpound" />
+            latin:keyIcon="@drawable/sym_keyboard_numpound"
+            latin:keyWidth="10.5%p " />
+        <!-- There is an empty area bellow the "Enter" key and right of the "#" key.  To ignore
+             the touch event on the area, "#" is intentionally not marked as a right edge key. -->
     </Row>
 </Keyboard>
diff --git a/java/res/xml-xlarge/kbd_popup_template.xml b/java/res/xml-xlarge/kbd_popup_template.xml
index 382d90afc2c1e0976ff69961ca97a0aec5b9b0e2..55ebda5e468e91869cb7f075d51c9fcfcff43139 100644
--- a/java/res/xml-xlarge/kbd_popup_template.xml
+++ b/java/res/xml-xlarge/kbd_popup_template.xml
@@ -20,7 +20,7 @@
 
 <Keyboard xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
     latin:keyWidth="7.5%p"
-    latin:horizontalGap="0px"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
     latin:verticalGap="0px"
     latin:keyHeight="@dimen/key_height"
     >
diff --git a/java/res/xml-xlarge/kbd_qwerty.xml b/java/res/xml-xlarge/kbd_qwerty.xml
index b7250341456986db578b87c38393a72d7ee18ff2..9485ca7b38687878162cade6a012e0e6282c4152 100644
--- a/java/res/xml-xlarge/kbd_qwerty.xml
+++ b/java/res/xml-xlarge/kbd_qwerty.xml
@@ -21,7 +21,7 @@
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
     latin:keyWidth="7.5%p"
-    latin:horizontalGap="0px"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
     latin:verticalGap="@dimen/key_bottom_gap"
     latin:keyHeight="@dimen/key_height"
 >
@@ -30,62 +30,63 @@
         <Key
             latin:codes="@integer/key_tab"
             latin:keyLabel="Tab"
+            latin:keyWidth="7.0%p"
             latin:isModifier="true"
             latin:keyEdgeFlags="left" />
         <Key
             latin:keyLabel="q"
-            latin:keyHintIcon="@drawable/keyboard_hint_1"
+            latin:keyHintIcon="@drawable/key_hint_1_holo"
             latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_q" />
         <Key
             latin:keyLabel="w"
-            latin:keyHintIcon="@drawable/keyboard_hint_2"
+            latin:keyHintIcon="@drawable/key_hint_2_holo"
             latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_w" />
         <Key
             latin:keyLabel="e"
-            latin:keyHintIcon="@drawable/keyboard_hint_3"
+            latin:keyHintIcon="@drawable/key_hint_3_holo"
             latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_e" />
         <Key
             latin:keyLabel="r"
-            latin:keyHintIcon="@drawable/keyboard_hint_4"
+            latin:keyHintIcon="@drawable/key_hint_4_holo"
             latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_r" />
         <Key
             latin:keyLabel="t"
-            latin:keyHintIcon="@drawable/keyboard_hint_5"
+            latin:keyHintIcon="@drawable/key_hint_5_holo"
             latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_t" />
         <Key
             latin:keyLabel="y"
-            latin:keyHintIcon="@drawable/keyboard_hint_6"
+            latin:keyHintIcon="@drawable/key_hint_6_holo"
             latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_y" />
         <Key
             latin:keyLabel="u"
-            latin:keyHintIcon="@drawable/keyboard_hint_7"
+            latin:keyHintIcon="@drawable/key_hint_7_holo"
             latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_u" />
         <Key
             latin:keyLabel="i"
-            latin:keyHintIcon="@drawable/keyboard_hint_8"
+            latin:keyHintIcon="@drawable/key_hint_8_holo"
             latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_i" />
         <Key
             latin:keyLabel="o"
-            latin:keyHintIcon="@drawable/keyboard_hint_9"
+            latin:keyHintIcon="@drawable/key_hint_9_holo"
             latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_o" />
         <Key
             latin:keyLabel="p"
-            latin:keyHintIcon="@drawable/keyboard_hint_0"
+            latin:keyHintIcon="@drawable/key_hint_0_holo"
             latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_p" />
         <Key
             latin:keyLabel="="
             latin:temporaryShiftKeyLabel="+"
-            latin:keyHintIcon="@drawable/keyboard_hint_plus"
+            latin:keyHintIcon="@drawable/key_hint_plus_holo"
             latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="+" />
         <Key
@@ -138,13 +139,13 @@
         <Key
             latin:keyLabel=";"
             latin:temporaryShiftKeyLabel=":"
-            latin:keyHintIcon="@drawable/keyboard_hint_colon"
+            latin:keyHintIcon="@drawable/key_hint_colon_holo"
             latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters=":" />
         <Key
             latin:keyLabel="\'"
             latin:temporaryShiftKeyLabel="&quot;"
-            latin:keyHintIcon="@drawable/keyboard_hint_quote"
+            latin:keyHintIcon="@drawable/key_hint_quote_holo"
             latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="&quot;" />
         <Key
@@ -195,13 +196,13 @@
         <Key
             latin:keyLabel=";"
             latin:temporaryShiftKeyLabel=":"
-            latin:keyHintIcon="@drawable/keyboard_hint_colon"
+            latin:keyHintIcon="@drawable/key_hint_colon_holo"
             latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters=":" />
         <Key
             latin:keyLabel="\'"
             latin:temporaryShiftKeyLabel="&quot;"
-            latin:keyHintIcon="@drawable/keyboard_hint_quote"
+            latin:keyHintIcon="@drawable/key_hint_quote_holo"
             latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="&quot;" />
         <Key
@@ -254,7 +255,7 @@
         <Key
             latin:keyLabel="\'"
             latin:temporaryShiftKeyLabel="&quot;"
-            latin:keyHintIcon="@drawable/keyboard_hint_quote"
+            latin:keyHintIcon="@drawable/key_hint_quote_holo"
             latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="&quot;" />
         <Key
@@ -305,13 +306,13 @@
         <Key
             latin:keyLabel=";"
             latin:temporaryShiftKeyLabel=":"
-            latin:keyHintIcon="@drawable/keyboard_hint_colon"
+            latin:keyHintIcon="@drawable/key_hint_colon_holo"
             latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters=":" />
         <Key
             latin:keyLabel="\'"
             latin:temporaryShiftKeyLabel="&quot;"
-            latin:keyHintIcon="@drawable/keyboard_hint_quote"
+            latin:keyHintIcon="@drawable/key_hint_quote_holo"
             latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="&quot;" />
         <Key
@@ -362,13 +363,13 @@
         <Key
             latin:keyLabel=";"
             latin:temporaryShiftKeyLabel=":"
-            latin:keyHintIcon="@drawable/keyboard_hint_colon"
+            latin:keyHintIcon="@drawable/key_hint_colon_holo"
             latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters=":" />
         <Key
             latin:keyLabel="\'"
             latin:temporaryShiftKeyLabel="&quot;"
-            latin:keyHintIcon="@drawable/keyboard_hint_quote"
+            latin:keyHintIcon="@drawable/key_hint_quote_holo"
             latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="&quot;" />
         <Key
@@ -415,19 +416,19 @@
         <Key
             latin:keyLabel=","
             latin:temporaryShiftKeyLabel="*"
-            latin:keyHintIcon="@drawable/keyboard_hint_star"
+            latin:keyHintIcon="@drawable/key_hint_star_holo"
             latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="*" />
         <Key
             latin:keyLabel="."
             latin:temporaryShiftKeyLabel="!"
-            latin:keyHintIcon="@drawable/keyboard_hint_exclamation"
+            latin:keyHintIcon="@drawable/key_hint_exclamation_holo"
             latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="!" />
         <Key
             latin:keyLabel="/"
             latin:temporaryShiftKeyLabel="\?"
-            latin:keyHintIcon="@drawable/keyboard_hint_question"
+            latin:keyHintIcon="@drawable/key_hint_question_holo"
             latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="\?" />
         <Key
@@ -475,19 +476,19 @@
         <Key
             latin:keyLabel=","
             latin:temporaryShiftKeyLabel="*"
-            latin:keyHintIcon="@drawable/keyboard_hint_star"
+            latin:keyHintIcon="@drawable/key_hint_star_holo"
             latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="*" />
         <Key
             latin:keyLabel="."
             latin:temporaryShiftKeyLabel="!"
-            latin:keyHintIcon="@drawable/keyboard_hint_exclamation"
+            latin:keyHintIcon="@drawable/key_hint_exclamation_holo"
             latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="!" />
         <Key
             latin:keyLabel="/"
             latin:temporaryShiftKeyLabel="\?"
-            latin:keyHintIcon="@drawable/keyboard_hint_question"
+            latin:keyHintIcon="@drawable/key_hint_question_holo"
             latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="\?" />
         <Key
@@ -583,19 +584,19 @@
         <Key
             latin:keyLabel=","
             latin:temporaryShiftKeyLabel="*"
-            latin:keyHintIcon="@drawable/keyboard_hint_star"
+            latin:keyHintIcon="@drawable/key_hint_star_holo"
             latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="*" />
         <Key
             latin:keyLabel="."
             latin:temporaryShiftKeyLabel="!"
-            latin:keyHintIcon="@drawable/keyboard_hint_exclamation"
+            latin:keyHintIcon="@drawable/key_hint_exclamation_holo"
             latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="!" />
         <Key
             latin:keyLabel="/"
             latin:temporaryShiftKeyLabel="\?"
-            latin:keyHintIcon="@drawable/keyboard_hint_question"
+            latin:keyHintIcon="@drawable/key_hint_question_holo"
             latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="\?" />
         <Key
@@ -643,19 +644,19 @@
         <Key
             latin:keyLabel=","
             latin:temporaryShiftKeyLabel="*"
-            latin:keyHintIcon="@drawable/keyboard_hint_star"
+            latin:keyHintIcon="@drawable/key_hint_star_holo"
             latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="*" />
         <Key
             latin:keyLabel="."
             latin:temporaryShiftKeyLabel="!"
-            latin:keyHintIcon="@drawable/keyboard_hint_exclamation"
+            latin:keyHintIcon="@drawable/key_hint_exclamation_holo"
             latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="!" />
         <Key
             latin:keyLabel="/"
             latin:temporaryShiftKeyLabel="\?"
-            latin:keyHintIcon="@drawable/keyboard_hint_question"
+            latin:keyHintIcon="@drawable/key_hint_question_holo"
             latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="\?" />
         <Key
@@ -671,17 +672,18 @@
     <Row
         latin:keyboardMode="@+id/mode_normal"
     >
+        <Spacer
+            latin:horizontalGap="16.25%p" />
         <Key
             latin:keyLabel="("
             latin:temporaryShiftKeyLabel="&lt;"
-            latin:keyHintIcon="@drawable/keyboard_hint_smaller"
+            latin:keyHintIcon="@drawable/key_hint_smaller_holo"
             latin:popupKeyboard="@xml/kbd_popup_template"
-            latin:popupCharacters="&lt;"
-            latin:horizontalGap="16.25%p" />
+            latin:popupCharacters="&lt;" />
         <Key
             latin:keyLabel=")"
             latin:temporaryShiftKeyLabel="&gt;"
-            latin:keyHintIcon="@drawable/keyboard_hint_greater"
+            latin:keyHintIcon="@drawable/key_hint_larger_holo"
             latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="&gt;" />
         <Key
@@ -693,7 +695,7 @@
         <Key
             latin:keyLabel="_"
             latin:temporaryShiftKeyLabel="\@"
-            latin:keyHintIcon="@drawable/keyboard_hint_at"
+            latin:keyHintIcon="@drawable/key_hint_at_holo"
             latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="\@" />
         <Key
@@ -706,11 +708,12 @@
     <Row
         latin:keyboardMode="@+id/mode_url"
     >
+        <Spacer
+            latin:horizontalGap="16.25%p" />
         <Key
             latin:keyLabel=".com"
-	    latin:keyOutputText=".com"
-	    latin:keyWidth="15.0%p"
-            latin:horizontalGap="16.25%p" />
+    	    latin:keyOutputText=".com"
+            latin:keyWidth="15.0%p" />
         <Key
             latin:codes="@integer/key_space"
             latin:keyIcon="@drawable/sym_keyboard_space"
@@ -720,7 +723,7 @@
         <Key
             latin:keyLabel="_"
             latin:temporaryShiftKeyLabel="\@"
-            latin:keyHintIcon="@drawable/keyboard_hint_at"
+            latin:keyHintIcon="@drawable/key_hint_at_holo"
             latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="\@" />
         <Key
@@ -733,11 +736,12 @@
     <Row
         latin:keyboardMode="@+id/mode_email"
     >
+        <Spacer
+            latin:horizontalGap="16.25%p" />
         <Key
             latin:keyLabel=".com"
-	    latin:keyOutputText=".com"
-	    latin:keyWidth="15.0%p"
-            latin:horizontalGap="16.25%p" />
+            latin:keyOutputText=".com"
+            latin:keyWidth="15.0%p" />
         <Key
             latin:codes="@integer/key_space"
             latin:keyIcon="@drawable/sym_keyboard_space"
@@ -752,12 +756,13 @@
     <Row
         latin:keyboardMode="@+id/mode_im"
     >
+        <Spacer
+            latin:horizontalGap="16.25%p" />
         <Key
             latin:keyLabel=":-)"
             latin:keyOutputText=":-)"
             latin:popupKeyboard="@xml/popup_smileys"
-            latin:keyWidth="15.0%p"
-            latin:horizontalGap="16.25%p" />
+            latin:keyWidth="15.0%p" />
         <Key
             latin:codes="@integer/key_space"
             latin:keyIcon="@drawable/sym_keyboard_space"
@@ -767,7 +772,7 @@
         <Key
             latin:keyLabel="_"
             latin:temporaryShiftKeyLabel="\@"
-            latin:keyHintIcon="@drawable/keyboard_hint_at"
+            latin:keyHintIcon="@drawable/key_hint_at_holo"
             latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="\@" />
         <Key
@@ -780,17 +785,18 @@
     <Row
         latin:keyboardMode="@+id/mode_webentry"
     >
+        <Spacer
+            latin:horizontalGap="16.25%p" />
         <Key
             latin:keyLabel="("
             latin:temporaryShiftKeyLabel="&lt;"
-            latin:keyHintIcon="@drawable/keyboard_hint_smaller"
+            latin:keyHintIcon="@drawable/key_hint_smaller_holo"
             latin:popupKeyboard="@xml/kbd_popup_template"
-            latin:popupCharacters="&lt;"
-            latin:horizontalGap="16.25%p" />
+            latin:popupCharacters="&lt;" />
         <Key
             latin:keyLabel=")"
             latin:temporaryShiftKeyLabel="&gt;"
-            latin:keyHintIcon="@drawable/keyboard_hint_greater"
+            latin:keyHintIcon="@drawable/key_hint_larger_holo"
             latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="&gt;" />
         <Key
@@ -802,7 +808,7 @@
         <Key
             latin:keyLabel="_"
             latin:temporaryShiftKeyLabel="\@"
-            latin:keyHintIcon="@drawable/keyboard_hint_at"
+            latin:keyHintIcon="@drawable/key_hint_at_holo"
             latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="\@" />
         <Key
diff --git a/java/res/xml-xlarge/kbd_symbols.xml b/java/res/xml-xlarge/kbd_symbols.xml
index e570ff4799b63e3743bececc1021573d607048e0..34fc11419609f3f429206d6341a77ab8f161e6de 100644
--- a/java/res/xml-xlarge/kbd_symbols.xml
+++ b/java/res/xml-xlarge/kbd_symbols.xml
@@ -21,8 +21,8 @@
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
     latin:keyWidth="7.5%p"
-    latin:horizontalGap="0px"
-    latin:verticalGap="0px"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
+    latin:verticalGap="@dimen/key_bottom_gap"
     latin:keyHeight="@dimen/key_height"
 >
     <!-- This row is intentionally not marked as a top row -->
@@ -30,6 +30,7 @@
         <Key
             latin:codes="@integer/key_tab"
             latin:keyLabel="Tab"
+            latin:keyWidth="7.0%p"
             latin:isModifier="true"
             latin:keyEdgeFlags="left" />
         <Key
@@ -140,9 +141,10 @@
     </Row>
     <!-- This row is intentionally not marked as a bottom row -->
     <Row>
-        <Key
-            latin:keyLabel="&lt;"
+        <Spacer
             latin:horizontalGap="16.25%p" />
+        <Key
+            latin:keyLabel="&lt;" />
         <Key
             latin:keyLabel="&gt;" />
         <Key
diff --git a/java/res/xml-xlarge/kbd_symbols_shift.xml b/java/res/xml-xlarge/kbd_symbols_shift.xml
index 5ca2cc1e6dd66441a9263955335c22533a7f804b..8ed1c110793f756c59f43fc757927a2a241e8023 100644
--- a/java/res/xml-xlarge/kbd_symbols_shift.xml
+++ b/java/res/xml-xlarge/kbd_symbols_shift.xml
@@ -21,8 +21,8 @@
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
     latin:keyWidth="7.5%p"
-    latin:horizontalGap="0px"
-    latin:verticalGap="0px"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
+    latin:verticalGap="@dimen/key_bottom_gap"
     latin:keyHeight="@dimen/key_height"
 >
     <!-- This row is intentionally not marked as a top row -->
@@ -30,6 +30,7 @@
         <Key
             latin:codes="@integer/key_tab"
             latin:keyLabel="Tab"
+            latin:keyWidth="7.0%p"
             latin:isModifier="true"
             latin:keyEdgeFlags="left" />
         <Key
@@ -140,9 +141,10 @@
     </Row>
     <!-- This row is intentionally not marked as a bottom row -->
     <Row>
-        <Key
-            latin:keyLabel="≤"
+        <Spacer
             latin:horizontalGap="16.25%p" />
+        <Key
+            latin:keyLabel="≤" />
         <Key
             latin:keyLabel="≥" />
         <Key
diff --git a/java/res/xml/kbd_phone.xml b/java/res/xml/kbd_phone.xml
index 17e7ba20b2a97f1bae5a5eac3dd323d30a061d80..e6f6a09f5f001d5771674128a695b81acc5e5a4d 100644
--- a/java/res/xml/kbd_phone.xml
+++ b/java/res/xml/kbd_phone.xml
@@ -21,7 +21,7 @@
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
     latin:keyWidth="26.67%p"
-    latin:horizontalGap="0px"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
     latin:verticalGap="@dimen/key_bottom_gap"
     latin:keyHeight="@dimen/key_height"
 >
diff --git a/java/res/xml/kbd_phone_black.xml b/java/res/xml/kbd_phone_black.xml
index 6ade277d93c085e2c6270932dfe978aa95076707..86759d676a05ed617eef8bfd050530b2ca85f498 100644
--- a/java/res/xml/kbd_phone_black.xml
+++ b/java/res/xml/kbd_phone_black.xml
@@ -21,7 +21,7 @@
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
     latin:keyWidth="26.67%p"
-    latin:horizontalGap="0px"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
     latin:verticalGap="@dimen/key_bottom_gap"
     latin:keyHeight="@dimen/key_height"
 >
diff --git a/java/res/xml/kbd_phone_symbols.xml b/java/res/xml/kbd_phone_symbols.xml
index 5062d4707f2f95a88062423c4c6fc9eecb4b8d33..1c691d2a54d19bb53870c82770460a5f0b9a398c 100644
--- a/java/res/xml/kbd_phone_symbols.xml
+++ b/java/res/xml/kbd_phone_symbols.xml
@@ -21,7 +21,7 @@
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
     latin:keyWidth="26.67%p"
-    latin:horizontalGap="0px"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
     latin:verticalGap="@dimen/key_bottom_gap"
     latin:keyHeight="@dimen/key_height"
 >
diff --git a/java/res/xml/kbd_phone_symbols_black.xml b/java/res/xml/kbd_phone_symbols_black.xml
index 2a6932a9ee1d209bd51d60a9a4990be3be753155..3e46c5307718f83ffe1c6af9229c05bace4cda6e 100644
--- a/java/res/xml/kbd_phone_symbols_black.xml
+++ b/java/res/xml/kbd_phone_symbols_black.xml
@@ -21,7 +21,7 @@
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
     latin:keyWidth="26.67%p"
-    latin:horizontalGap="0px"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
     latin:verticalGap="@dimen/key_bottom_gap"
     latin:keyHeight="@dimen/key_height"
 >
diff --git a/java/res/xml/kbd_popup_template.xml b/java/res/xml/kbd_popup_template.xml
index f1aa86f392029b977c4a461f0c14463a5e783a49..004d490d60705972b8f73e2cf97963733556f473 100644
--- a/java/res/xml/kbd_popup_template.xml
+++ b/java/res/xml/kbd_popup_template.xml
@@ -20,7 +20,7 @@
 
 <Keyboard xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
     latin:keyWidth="10%p"
-    latin:horizontalGap="0px"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
     latin:verticalGap="0px"
     latin:keyHeight="@dimen/popup_key_height"
     >
diff --git a/java/res/xml/kbd_qwerty.xml b/java/res/xml/kbd_qwerty.xml
index 21a7ccb781a42404d3c93dbc04ca29a22c1a24b4..517b4fe5c68e53824d23dc2dd1ada0ee224aa8c8 100644
--- a/java/res/xml/kbd_qwerty.xml
+++ b/java/res/xml/kbd_qwerty.xml
@@ -21,7 +21,7 @@
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
     latin:keyWidth="10%p"
-    latin:horizontalGap="0px"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
     latin:verticalGap="@dimen/key_bottom_gap"
     latin:keyHeight="@dimen/key_height"
 >
@@ -82,11 +82,12 @@
             latin:keyEdgeFlags="right" />
     </Row>
     <Row>
+        <Spacer
+            latin:horizontalGap="5%p" />
         <Key
             latin:keyLabel="a"
             latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_a"
-            latin:horizontalGap="5%p"
             latin:keyEdgeFlags="left" />
         <Key
             latin:keyLabel="s"
diff --git a/java/res/xml/kbd_qwerty_black.xml b/java/res/xml/kbd_qwerty_black.xml
index adb10dcfb588efbfb02bd970f82490575f26c013..76412f664914a569df9443ed7d9b32ed4b9959d9 100644
--- a/java/res/xml/kbd_qwerty_black.xml
+++ b/java/res/xml/kbd_qwerty_black.xml
@@ -21,7 +21,7 @@
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
     latin:keyWidth="10%p"
-    latin:horizontalGap="0px"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
     latin:verticalGap="@dimen/key_bottom_gap"
     latin:keyHeight="@dimen/key_height"
 >
@@ -82,11 +82,12 @@
             latin:keyEdgeFlags="right" />
     </Row>
     <Row>
+        <Spacer
+            latin:horizontalGap="5%p" />
         <Key
             latin:keyLabel="a"
             latin:popupKeyboard="@xml/kbd_popup_template"
             latin:popupCharacters="@string/alternates_for_a"
-            latin:horizontalGap="5%p"
             latin:keyEdgeFlags="left" />
         <Key
             latin:keyLabel="s"
diff --git a/java/res/xml/kbd_symbols.xml b/java/res/xml/kbd_symbols.xml
index 4ce9a867b5ac32ad470aa532218e222a3a562c82..83fb5a71de6b7e4ef53f9c1638a63925f65b530b 100644
--- a/java/res/xml/kbd_symbols.xml
+++ b/java/res/xml/kbd_symbols.xml
@@ -21,7 +21,7 @@
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
     latin:keyWidth="10%p"
-    latin:horizontalGap="0px"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
     latin:verticalGap="@dimen/key_bottom_gap"
     latin:keyHeight="@dimen/key_height"
 >
diff --git a/java/res/xml/kbd_symbols_black.xml b/java/res/xml/kbd_symbols_black.xml
index dedd2da08e8bca46c8d3c51bbb1d1ebaf29584f5..b6a069c25fad23ad7c878b2e142200c1b7bdaa75 100644
--- a/java/res/xml/kbd_symbols_black.xml
+++ b/java/res/xml/kbd_symbols_black.xml
@@ -21,7 +21,7 @@
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
     latin:keyWidth="10%p"
-    latin:horizontalGap="0px"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
     latin:verticalGap="@dimen/key_bottom_gap"
     latin:keyHeight="@dimen/key_height"
 >
diff --git a/java/res/xml/kbd_symbols_shift.xml b/java/res/xml/kbd_symbols_shift.xml
index 52afa38e336f7371cca1197ea63bc1eee5a8d30b..d83706b5cdd56bfcfd117ff34ccf9c2c0b516b7e 100644
--- a/java/res/xml/kbd_symbols_shift.xml
+++ b/java/res/xml/kbd_symbols_shift.xml
@@ -21,7 +21,7 @@
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
     latin:keyWidth="10%p"
-    latin:horizontalGap="0px"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
     latin:verticalGap="@dimen/key_bottom_gap"
     latin:keyHeight="@dimen/key_height"
 >
diff --git a/java/res/xml/kbd_symbols_shift_black.xml b/java/res/xml/kbd_symbols_shift_black.xml
index c1bd4e395aeda4e7b973b67477841056dc56676b..e5f8abf6e003ef95569850b0c18dd52e38738b8d 100644
--- a/java/res/xml/kbd_symbols_shift_black.xml
+++ b/java/res/xml/kbd_symbols_shift_black.xml
@@ -21,7 +21,7 @@
 <Keyboard
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
     latin:keyWidth="10%p"
-    latin:horizontalGap="0px"
+    latin:horizontalGap="@dimen/key_horizontal_gap"
     latin:verticalGap="@dimen/key_bottom_gap"
     latin:keyHeight="@dimen/key_height"
 >
diff --git a/java/src/com/android/inputmethod/latin/BaseKeyboard.java b/java/src/com/android/inputmethod/latin/BaseKeyboard.java
index bad1544e5e792d7b365ccee6e9140b7f4d79aa00..fc35ccc5debf813041c5695fcc6bc066f200a91e 100644
--- a/java/src/com/android/inputmethod/latin/BaseKeyboard.java
+++ b/java/src/com/android/inputmethod/latin/BaseKeyboard.java
@@ -61,6 +61,7 @@ public class BaseKeyboard {
     private static final String TAG_KEYBOARD = "Keyboard";
     private static final String TAG_ROW = "Row";
     private static final String TAG_KEY = "Key";
+    private static final String TAG_SPACER = "Spacer";
     private static final String TAG_INCLUDE = "include";
     private static final String TAG_MERGE = "merge";
 
@@ -273,8 +274,8 @@ public class BaseKeyboard {
         public Key(Row parent) {
             keyboard = parent.parent;
             height = parent.defaultHeight;
-            width = parent.defaultWidth;
             gap = parent.defaultHorizontalGap;
+            width = parent.defaultWidth - gap;
             edgeFlags = parent.rowEdgeFlags;
         }
 
@@ -290,21 +291,21 @@ public class BaseKeyboard {
         public Key(Resources res, Row parent, int x, int y, XmlResourceParser parser) {
             this(parent);
 
-            this.x = x;
-            this.y = y;
-
             TypedArray a = res.obtainAttributes(Xml.asAttributeSet(parser),
                     R.styleable.BaseKeyboard);
-
-            width = getDimensionOrFraction(a, R.styleable.BaseKeyboard_keyWidth,
-                    keyboard.mDisplayWidth, parent.defaultWidth);
             height = getDimensionOrFraction(a, R.styleable.BaseKeyboard_keyHeight,
                     keyboard.mDisplayHeight, parent.defaultHeight);
             gap = getDimensionOrFraction(a, R.styleable.BaseKeyboard_horizontalGap,
                     keyboard.mDisplayWidth, parent.defaultHorizontalGap);
+            width = getDimensionOrFraction(a, R.styleable.BaseKeyboard_keyWidth,
+                    keyboard.mDisplayWidth, parent.defaultWidth) - gap;
             a.recycle();
             a = res.obtainAttributes(Xml.asAttributeSet(parser), R.styleable.BaseKeyboard_Key);
-            this.x += gap;
+
+            // Horizontal gap is divided equally to both sides of the key.
+            this.x = x + gap / 2;
+            this.y = y;
+
             TypedValue codesValue = new TypedValue();
             a.getValue(R.styleable.BaseKeyboard_Key_codes, codesValue);
             if (codesValue.type == TypedValue.TYPE_INT_DEC
@@ -731,6 +732,10 @@ public class BaseKeyboard {
             mTotalHeight = mCurrentY - defaultVerticalGap;
         }
 
+        public void setSpacer(int gap) {
+            mCurrentX += gap;
+        }
+
         public int getMaxRowWidth() {
             return mMaxRowWidth;
         }
@@ -774,6 +779,8 @@ public class BaseKeyboard {
                     mKeys.add(key);
                     if (key.codes[0] == KEYCODE_SHIFT)
                         mShiftKeys.add(key);
+                } else if (TAG_SPACER.equals(tag)) {
+                    parseSpacerAttribute(res, parser, state);
                 } else if (TAG_KEYBOARD.equals(tag)) {
                     parseKeyboardAttributes(res, parser);
                 } else if (TAG_INCLUDE.equals(tag)) {
@@ -791,6 +798,8 @@ public class BaseKeyboard {
                     state.endKey(key);
                 } else if (TAG_ROW.equals(tag)) {
                     state.endRow();
+                } else if (TAG_SPACER.equals(tag)) {
+                    ;
                 } else if (TAG_KEYBOARD.equals(tag)) {
                     state.endKeyboard(mDefaultVerticalGap);
                 } else if (TAG_INCLUDE.equals(tag)) {
@@ -804,6 +813,15 @@ public class BaseKeyboard {
         }
     }
 
+    private void parseSpacerAttribute(Resources res, XmlResourceParser parser,
+            KeyboardParseState state) {
+        TypedArray a = res.obtainAttributes(Xml.asAttributeSet(parser), R.styleable.BaseKeyboard);
+        int gap = getDimensionOrFraction(a,
+                R.styleable.BaseKeyboard_horizontalGap, mDisplayWidth, 0);
+        a.recycle();
+        state.setSpacer(gap);
+    }
+
     private void parseInclude(Resources res, XmlResourceParser parent, KeyboardParseState state)
             throws XmlPullParserException, IOException {
         final TypedArray a = res.obtainAttributes(Xml.asAttributeSet(parent),
@@ -848,19 +866,14 @@ public class BaseKeyboard {
     private void parseKeyboardAttributes(Resources res, XmlResourceParser parser) {
         TypedArray a = res.obtainAttributes(Xml.asAttributeSet(parser),
                 R.styleable.BaseKeyboard);
-
         mDefaultWidth = getDimensionOrFraction(a,
-                R.styleable.BaseKeyboard_keyWidth,
-                mDisplayWidth, mDisplayWidth / 10);
+                R.styleable.BaseKeyboard_keyWidth, mDisplayWidth, mDisplayWidth / 10);
         mDefaultHeight = getDimensionOrFraction(a,
-                R.styleable.BaseKeyboard_keyHeight,
-                mDisplayHeight, 50);
+                R.styleable.BaseKeyboard_keyHeight, mDisplayHeight, 50);
         mDefaultHorizontalGap = getDimensionOrFraction(a,
-                R.styleable.BaseKeyboard_horizontalGap,
-                mDisplayWidth, 0);
+                R.styleable.BaseKeyboard_horizontalGap, mDisplayWidth, 0);
         mDefaultVerticalGap = getDimensionOrFraction(a,
-                R.styleable.BaseKeyboard_verticalGap,
-                mDisplayHeight, 0);
+                R.styleable.BaseKeyboard_verticalGap, mDisplayHeight, 0);
         mProximityThreshold = (int) (mDefaultWidth * SEARCH_DISTANCE);
         mProximityThreshold = mProximityThreshold * mProximityThreshold;
         a.recycle();