diff --git a/java/src/com/android/inputmethod/keyboard/MiniKeyboardView.java b/java/src/com/android/inputmethod/keyboard/MiniKeyboardView.java
index f331662..29861fe 100644
--- a/java/src/com/android/inputmethod/keyboard/MiniKeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/MiniKeyboardView.java
@@ -27,7 +27,6 @@
 import com.android.inputmethod.keyboard.PointerTracker.TimerProxy;
 import com.android.inputmethod.latin.R;
 
-import java.util.List;
 
 /**
  * A view that renders a virtual {@link MiniKeyboard}. It handles rendering of keys and detecting
@@ -43,51 +42,6 @@
     private int mOriginX;
     private int mOriginY;
 
-    private static class MiniKeyboardKeyDetector extends KeyDetector {
-        private final int mSlideAllowanceSquare;
-        private final int mSlideAllowanceSquareTop;
-
-        public MiniKeyboardKeyDetector(float slideAllowance) {
-            super(/* keyHysteresisDistance */0);
-            mSlideAllowanceSquare = (int)(slideAllowance * slideAllowance);
-            // Top slide allowance is slightly longer (sqrt(2) times) than other edges.
-            mSlideAllowanceSquareTop = mSlideAllowanceSquare * 2;
-        }
-
-        @Override
-        public boolean alwaysAllowsSlidingInput() {
-            return true;
-        }
-
-        @Override
-        protected int getMaxNearbyKeys() {
-            // No nearby key will be returned.
-            return 1;
-        }
-
-        @Override
-        public int getKeyIndexAndNearbyCodes(int x, int y, final int[] allCodes) {
-            final List<Key> keys = getKeyboard().mKeys;
-            final int touchX = getTouchX(x);
-            final int touchY = getTouchY(y);
-
-            int nearestIndex = NOT_A_KEY;
-            int nearestDist = (y < 0) ? mSlideAllowanceSquareTop : mSlideAllowanceSquare;
-            final int keyCount = keys.size();
-            for (int index = 0; index < keyCount; index++) {
-                final int dist = keys.get(index).squaredDistanceToEdge(touchX, touchY);
-                if (dist < nearestDist) {
-                    nearestIndex = index;
-                    nearestDist = dist;
-                }
-            }
-
-            if (allCodes != null && nearestIndex != NOT_A_KEY)
-                allCodes[0] = keys.get(nearestIndex).mCode;
-            return nearestIndex;
-        }
-    }
-
     private static final TimerProxy EMPTY_TIMER_PROXY = new TimerProxy.Adapter();
 
     private final KeyboardActionListener mMiniKeyboardListener =
@@ -126,7 +80,7 @@
 
         final Resources res = context.getResources();
         // Override default ProximityKeyDetector.
-        mKeyDetector = new MiniKeyboardKeyDetector(res.getDimension(
+        mKeyDetector = new MoreKeysDetector(res.getDimension(
                 R.dimen.mini_keyboard_slide_allowance));
         // Remove gesture detector on mini-keyboard
         setKeyPreviewPopupEnabled(false, 0);
diff --git a/java/src/com/android/inputmethod/keyboard/MoreKeysDetector.java b/java/src/com/android/inputmethod/keyboard/MoreKeysDetector.java
new file mode 100644
index 0000000..d202046
--- /dev/null
+++ b/java/src/com/android/inputmethod/keyboard/MoreKeysDetector.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2011 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.
+ */
+
+package com.android.inputmethod.keyboard;
+
+import java.util.List;
+
+public class MoreKeysDetector extends KeyDetector {
+    private final int mSlideAllowanceSquare;
+    private final int mSlideAllowanceSquareTop;
+
+    public MoreKeysDetector(float slideAllowance) {
+        super(/* keyHysteresisDistance */0);
+        mSlideAllowanceSquare = (int)(slideAllowance * slideAllowance);
+        // Top slide allowance is slightly longer (sqrt(2) times) than other edges.
+        mSlideAllowanceSquareTop = mSlideAllowanceSquare * 2;
+    }
+
+    @Override
+    public boolean alwaysAllowsSlidingInput() {
+        return true;
+    }
+
+    @Override
+    protected int getMaxNearbyKeys() {
+        // No nearby key will be returned.
+        return 1;
+    }
+
+    @Override
+    public int getKeyIndexAndNearbyCodes(int x, int y, final int[] allCodes) {
+        final List<Key> keys = getKeyboard().mKeys;
+        final int touchX = getTouchX(x);
+        final int touchY = getTouchY(y);
+
+        int nearestIndex = NOT_A_KEY;
+        int nearestDist = (y < 0) ? mSlideAllowanceSquareTop : mSlideAllowanceSquare;
+        final int keyCount = keys.size();
+        for (int index = 0; index < keyCount; index++) {
+            final int dist = keys.get(index).squaredDistanceToEdge(touchX, touchY);
+            if (dist < nearestDist) {
+                nearestIndex = index;
+                nearestDist = dist;
+            }
+        }
+
+        if (allCodes != null && nearestIndex != NOT_A_KEY)
+            allCodes[0] = keys.get(nearestIndex).mCode;
+        return nearestIndex;
+    }
+}
\ No newline at end of file
diff --git a/java/src/com/android/inputmethod/latin/MoreSuggestionsView.java b/java/src/com/android/inputmethod/latin/MoreSuggestionsView.java
index 8284901..9fd9024 100644
--- a/java/src/com/android/inputmethod/latin/MoreSuggestionsView.java
+++ b/java/src/com/android/inputmethod/latin/MoreSuggestionsView.java
@@ -23,17 +23,15 @@
 import android.view.View;
 import android.widget.PopupWindow;
 
-import com.android.inputmethod.keyboard.Key;
 import com.android.inputmethod.keyboard.KeyDetector;
 import com.android.inputmethod.keyboard.Keyboard;
 import com.android.inputmethod.keyboard.KeyboardActionListener;
 import com.android.inputmethod.keyboard.KeyboardView;
+import com.android.inputmethod.keyboard.MoreKeysDetector;
 import com.android.inputmethod.keyboard.MoreKeysPanel;
-import com.android.inputmethod.keyboard.PointerTracker;
 import com.android.inputmethod.keyboard.PointerTracker.DrawingProxy;
 import com.android.inputmethod.keyboard.PointerTracker.TimerProxy;
 
-import java.util.List;
 
 /**
  * A view that renders a virtual {@link MoreSuggestions}. It handles rendering of keys and detecting
@@ -49,51 +47,6 @@
     private int mOriginX;
     private int mOriginY;
 
-    private static class SuggestionsPaneKeyDetector extends KeyDetector {
-        private final int mSlideAllowanceSquare;
-        private final int mSlideAllowanceSquareTop;
-
-        public SuggestionsPaneKeyDetector(float slideAllowance) {
-            super(/* keyHysteresisDistance */0);
-            mSlideAllowanceSquare = (int)(slideAllowance * slideAllowance);
-            // Top slide allowance is slightly longer (sqrt(2) times) than other edges.
-            mSlideAllowanceSquareTop = mSlideAllowanceSquare * 2;
-        }
-
-        @Override
-        public boolean alwaysAllowsSlidingInput() {
-            return true;
-        }
-
-        @Override
-        protected int getMaxNearbyKeys() {
-            // No nearby key will be returned.
-            return 1;
-        }
-
-        @Override
-        public int getKeyIndexAndNearbyCodes(int x, int y, final int[] allCodes) {
-            final List<Key> keys = getKeyboard().mKeys;
-            final int touchX = getTouchX(x);
-            final int touchY = getTouchY(y);
-
-            int nearestIndex = NOT_A_KEY;
-            int nearestDist = (y < 0) ? mSlideAllowanceSquareTop : mSlideAllowanceSquare;
-            final int keyCount = keys.size();
-            for (int index = 0; index < keyCount; index++) {
-                final int dist = keys.get(index).squaredDistanceToEdge(touchX, touchY);
-                if (dist < nearestDist) {
-                    nearestIndex = index;
-                    nearestDist = dist;
-                }
-            }
-
-            if (allCodes != null && nearestIndex != NOT_A_KEY)
-                allCodes[0] = keys.get(nearestIndex).mCode;
-            return nearestIndex;
-        }
-    }
-
     private static final TimerProxy EMPTY_TIMER_PROXY = new TimerProxy.Adapter();
 
     private final KeyboardActionListener mSuggestionsPaneListener =
@@ -128,7 +81,7 @@
 
         final Resources res = context.getResources();
         // Override default ProximityKeyDetector.
-        mKeyDetector = new SuggestionsPaneKeyDetector(res.getDimension(
+        mKeyDetector = new MoreKeysDetector(res.getDimension(
                 R.dimen.more_suggestions_slide_allowance));
         // Remove gesture detector on suggestions pane
         setKeyPreviewPopupEnabled(false, 0);
