diff --git a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
index 8d4beec..a0ac475 100644
--- a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java
@@ -370,7 +370,9 @@
             // When user hits the space or the enter key, just cancel the while-typing timer.
             final int typedCode = typedKey.mCode;
             if (typedCode == Constants.CODE_SPACE || typedCode == Constants.CODE_ENTER) {
-                startWhileTypingFadeinAnimation(keyboardView);
+                if (isTyping) {
+                    startWhileTypingFadeinAnimation(keyboardView);
+                }
                 return;
             }
 
@@ -614,8 +616,18 @@
 
     @ExternallyReferenced
     public void setAltCodeKeyWhileTypingAnimAlpha(final int alpha) {
+        if (mAltCodeKeyWhileTypingAnimAlpha == alpha) {
+            return;
+        }
+        // Update the visual of alt-code-key-while-typing.
         mAltCodeKeyWhileTypingAnimAlpha = alpha;
-        updateAltCodeKeyWhileTyping();
+        final Keyboard keyboard = getKeyboard();
+        if (keyboard == null) {
+            return;
+        }
+        for (final Key key : keyboard.mAltCodeKeysWhileTyping) {
+            invalidateKey(key);
+        }
     }
 
     public void setKeyboardActionListener(final KeyboardActionListener listener) {
@@ -1282,16 +1294,6 @@
         invalidateKey(shortcutKey);
     }
 
-    private void updateAltCodeKeyWhileTyping() {
-        final Keyboard keyboard = getKeyboard();
-        if (keyboard == null) {
-            return;
-        }
-        for (final Key key : keyboard.mAltCodeKeysWhileTyping) {
-            invalidateKey(key);
-        }
-    }
-
     public void startDisplayLanguageOnSpacebar(final boolean subtypeChanged,
             final boolean needsToDisplayLanguage, final boolean hasMultipleEnabledIMEsOrSubtypes) {
         mNeedsToDisplayLanguage = needsToDisplayLanguage;
