diff --git a/java/src/com/android/inputmethod/keyboard/emoji/EmojiPageKeyboardView.java b/java/src/com/android/inputmethod/keyboard/emoji/EmojiPageKeyboardView.java
index 48efa17ade3c678ee1ab61101d68694db92328f6..4d74ea9892c9052eb9716c792fec5c5cab429337 100644
--- a/java/src/com/android/inputmethod/keyboard/emoji/EmojiPageKeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/emoji/EmojiPageKeyboardView.java
@@ -102,7 +102,7 @@ final class EmojiPageKeyboardView extends KeyboardView implements
         }
         final Key key = getKey(e);
         if (key != null && key != mCurrentKey) {
-            releaseCurrentKey();
+            releaseCurrentKey(false /* withKeyRegistering */);
         }
         return true;
     }
@@ -119,7 +119,7 @@ final class EmojiPageKeyboardView extends KeyboardView implements
         return mKeyDetector.detectHitKey(x, y);
     }
 
-    public void releaseCurrentKey() {
+    public void releaseCurrentKey(final boolean withKeyRegistering) {
         mHandler.removeCallbacks(mPendingKeyDown);
         mPendingKeyDown = null;
         final Key currentKey = mCurrentKey;
@@ -128,13 +128,16 @@ final class EmojiPageKeyboardView extends KeyboardView implements
         }
         currentKey.onReleased();
         invalidateKey(currentKey);
+        if (withKeyRegistering) {
+            mListener.onReleaseKey(currentKey);
+        }
         mCurrentKey = null;
     }
 
     @Override
     public boolean onDown(final MotionEvent e) {
         final Key key = getKey(e);
-        releaseCurrentKey();
+        releaseCurrentKey(false /* withKeyRegistering */);
         mCurrentKey = key;
         if (key == null) {
             return false;
@@ -163,7 +166,7 @@ final class EmojiPageKeyboardView extends KeyboardView implements
         final Key key = getKey(e);
         final Runnable pendingKeyDown = mPendingKeyDown;
         final Key currentKey = mCurrentKey;
-        releaseCurrentKey();
+        releaseCurrentKey(false /* withKeyRegistering */);
         if (key == null) {
             return false;
         }
@@ -189,14 +192,14 @@ final class EmojiPageKeyboardView extends KeyboardView implements
     @Override
     public boolean onScroll(final MotionEvent e1, final MotionEvent e2, final float distanceX,
            final float distanceY) {
-        releaseCurrentKey();
+        releaseCurrentKey(false /* withKeyRegistering */);
         return false;
     }
 
     @Override
     public boolean onFling(final MotionEvent e1, final MotionEvent e2, final float velocityX,
             final float velocityY) {
-        releaseCurrentKey();
+        releaseCurrentKey(false /* withKeyRegistering */);
         return false;
     }
 
diff --git a/java/src/com/android/inputmethod/keyboard/emoji/EmojiPalettesAdapter.java b/java/src/com/android/inputmethod/keyboard/emoji/EmojiPalettesAdapter.java
index b1e6dd31805de658f323a6296e59cde48c7e7a8d..68056e0ebad1acdd8bc476f40dbf1e6b458747a1 100644
--- a/java/src/com/android/inputmethod/keyboard/emoji/EmojiPalettesAdapter.java
+++ b/java/src/com/android/inputmethod/keyboard/emoji/EmojiPalettesAdapter.java
@@ -68,13 +68,18 @@ final class EmojiPalettesAdapter extends PagerAdapter {
     }
 
     public void onPageScrolled() {
+        releaseCurrentKey(false /* withKeyRegistering */);
+    }
+
+    public void releaseCurrentKey(final boolean withKeyRegistering) {
         // Make sure the delayed key-down event (highlight effect and haptic feedback) will be
         // canceled.
         final EmojiPageKeyboardView currentKeyboardView =
                 mActiveKeyboardViews.get(mActivePosition);
-        if (currentKeyboardView != null) {
-            currentKeyboardView.releaseCurrentKey();
+        if (currentKeyboardView == null) {
+            return;
         }
+        currentKeyboardView.releaseCurrentKey(withKeyRegistering);
     }
 
     @Override
@@ -90,7 +95,7 @@ final class EmojiPalettesAdapter extends PagerAdapter {
         }
         final EmojiPageKeyboardView oldKeyboardView = mActiveKeyboardViews.get(mActivePosition);
         if (oldKeyboardView != null) {
-            oldKeyboardView.releaseCurrentKey();
+            oldKeyboardView.releaseCurrentKey(false /* withKeyRegistering */);
             oldKeyboardView.deallocateMemory();
         }
         mActivePosition = position;
diff --git a/java/src/com/android/inputmethod/keyboard/emoji/EmojiPalettesView.java b/java/src/com/android/inputmethod/keyboard/emoji/EmojiPalettesView.java
index 7368f3c728faa0e46bd790c6376f8db475c0ac7f..f9e25bcc35995fb81fe71b86e2ce796b6bac111a 100644
--- a/java/src/com/android/inputmethod/keyboard/emoji/EmojiPalettesView.java
+++ b/java/src/com/android/inputmethod/keyboard/emoji/EmojiPalettesView.java
@@ -380,6 +380,7 @@ public final class EmojiPalettesView extends LinearLayout implements OnTabChange
     }
 
     public void stopEmojiPalettes() {
+        mEmojiPalettesAdapter.releaseCurrentKey(true /* withKeyRegistering */);
         mEmojiPalettesAdapter.flushPendingRecentKeys();
         mEmojiPager.setAdapter(null);
     }