diff --git a/java/src/com/android/inputmethod/keyboard/Key.java b/java/src/com/android/inputmethod/keyboard/Key.java
index f578bd6130ccacac2a6dd4b76ed6486c2652d2d2..59c132e91ed68431c18647e9f580f5a14c57af29 100644
--- a/java/src/com/android/inputmethod/keyboard/Key.java
+++ b/java/src/com/android/inputmethod/keyboard/Key.java
@@ -379,7 +379,7 @@ public class Key {
      * @see android.graphics.drawable.StateListDrawable#setState(int[])
      */
     public int[] getCurrentDrawableState() {
-        final boolean pressed = mEnabled && mPressed;
+        final boolean pressed = mPressed;
         if (!mSticky && mFunctional) {
             if (pressed) {
                 return KEY_STATE_FUNCTIONAL_PRESSED;
diff --git a/java/src/com/android/inputmethod/keyboard/PointerTracker.java b/java/src/com/android/inputmethod/keyboard/PointerTracker.java
index c28197014aa552b6280d5e1a812dd19078006b38..eb5335ffd8605373c66a190b458b16ff27279e83 100644
--- a/java/src/com/android/inputmethod/keyboard/PointerTracker.java
+++ b/java/src/com/android/inputmethod/keyboard/PointerTracker.java
@@ -546,6 +546,9 @@ public class PointerTracker {
     }
 
     private void showKeyPreviewAndUpdateKeyGraphics(int keyIndex) {
+        final Key key = getKey(keyIndex);
+        if (key != null && !key.mEnabled)
+            return;
         updateKeyGraphics(keyIndex);
         // The modifier key, such as shift key, should not be shown as preview when multi-touch is
         // supported. On the other hand, if multi-touch is not supported, the modifier key should
@@ -565,6 +568,8 @@ public class PointerTracker {
             return;
         }
         Key key = getKey(keyIndex);
+        if (!key.mEnabled)
+            return;
         if (key.mCode == Keyboard.CODE_SHIFT) {
             mHandler.startLongPressShiftTimer(mLongPressShiftKeyTimeout, keyIndex, this);
         } else if (key.mManualTemporaryUpperCaseCode != Keyboard.CODE_DUMMY