diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml
index b3bd0fe591379a75009a3c98a00f2a089d4b3159..bd7c550c1711841551e05722ef394224ddf3693c 100644
--- a/java/res/values/attrs.xml
+++ b/java/res/values/attrs.xml
@@ -269,6 +269,10 @@
             <!-- If true, character case of code, altCode, moreKeys, keyOutputText, keyLabel,
                  or keyHintLabel will never be subject to change. -->
             <flag name="preserveCase" value="0x8000" />
+            <!-- If true, use keyTextInactivatedColor for the label -->
+            <flag name="inactivatedLabel" value="0x10000" />
+            <!-- If true, use keyUppercaseLetterInactivatedColor for the uppercase letter -->
+            <flag name="inactivatedUppercaseLetter" value="0x20000" />
         </attr>
         <!-- The icon to display on the key instead of the label. -->
         <attr name="keyIcon" format="enum">
diff --git a/java/src/com/android/inputmethod/keyboard/Key.java b/java/src/com/android/inputmethod/keyboard/Key.java
index 9c495fd5f8719aa27aaf312bf25e88f9244eaab2..bb90653c16b1c2492992c1e7f5e3a21a405db067 100644
--- a/java/src/com/android/inputmethod/keyboard/Key.java
+++ b/java/src/com/android/inputmethod/keyboard/Key.java
@@ -72,6 +72,8 @@ public class Key {
     private static final int LABEL_FLAGS_WITH_ICON_RIGHT = 0x2000;
     private static final int LABEL_FLAGS_AUTO_X_SCALE = 0x4000;
     private static final int LABEL_FLAGS_PRESERVE_CASE = 0x8000;
+    private static final int LABEL_FLAGS_INACTIVATED_LABEL = 0x10000;
+    private static final int LABEL_FLAGS_INACTIVATED_UPPERCASE_LETTER = 0x20000;
 
     /** Icon to display instead of a label. Icon takes precedence over a label */
     private final int mIconAttrId;
@@ -509,6 +511,14 @@ public class Key {
         return (mLabelFlags & LABEL_FLAGS_AUTO_X_SCALE) != 0;
     }
 
+    public boolean isInactivatedLabel() {
+        return (mLabelFlags & LABEL_FLAGS_INACTIVATED_LABEL) != 0;
+    }
+
+    public boolean isInactivatedUppercaseLetter() {
+        return (mLabelFlags & LABEL_FLAGS_INACTIVATED_UPPERCASE_LETTER) != 0;
+    }
+
     // TODO: Get rid of this method.
     public Drawable getIcon(KeyboardIconsSet iconSet) {
         return mEnabled ? mIcon : iconSet.getIconByAttrId(mDisabledIconAttrId);
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardView.java b/java/src/com/android/inputmethod/keyboard/KeyboardView.java
index 6f4ef2580c264b5e21d2784a087630daf4f705e4..d977327a8f36ec1059cafa3844fc7ba3b6b88e1a 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardView.java
@@ -571,8 +571,11 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy {
                         Math.min(1.0f, (keyWidth * MAX_LABEL_RATIO) / getLabelWidth(label, paint)));
             }
 
+            // TODO: Remove this first if-clause.
             if (key.hasUppercaseLetter() && mKeyboard.isManualTemporaryUpperCase()) {
                 paint.setColor(params.mKeyTextInactivatedColor);
+            } else if (key.isInactivatedLabel()) {
+                paint.setColor(params.mKeyTextInactivatedColor);
             } else {
                 paint.setColor(params.mKeyTextColor);
             }
@@ -618,9 +621,14 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy {
                 hintSize = params.mKeyHintLabelSize;
                 paint.setTypeface(Typeface.DEFAULT);
             } else if (key.hasUppercaseLetter()) {
-                hintColor = mKeyboard.isManualTemporaryUpperCase()
-                        ? params.mKeyUppercaseLetterActivatedColor
-                        : params.mKeyUppercaseLetterInactivatedColor;
+                // TODO: Remove this first if-clause.
+                if (mKeyboard.isManualTemporaryUpperCase()) {
+                    hintColor = params.mKeyUppercaseLetterActivatedColor;
+                } else if (!key.isInactivatedUppercaseLetter()) {
+                    hintColor = params.mKeyUppercaseLetterActivatedColor;
+                } else {
+                    hintColor = params.mKeyUppercaseLetterInactivatedColor;
+                }
                 hintSize = params.mKeyUppercaseLetterSize;
             } else { // key.hasHintLetter()
                 hintColor = params.mKeyHintLetterColor;