diff --git a/java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java b/java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java
index 4c109c7..cef8226 100644
--- a/java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java
+++ b/java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java
@@ -23,7 +23,6 @@
 import android.inputmethodservice.InputMethodService;
 import android.util.Log;
 import android.view.MotionEvent;
-import android.view.ViewConfiguration;
 import android.view.accessibility.AccessibilityEvent;
 import android.view.inputmethod.EditorInfo;
 
@@ -38,18 +37,12 @@
     private static final String TAG = AccessibleKeyboardViewProxy.class.getSimpleName();
     private static final AccessibleKeyboardViewProxy sInstance = new AccessibleKeyboardViewProxy();
 
-    // Delay in milliseconds between key press DOWN and UP events
-    private static final long DELAY_KEY_PRESS = 10;
-
     private InputMethodService mInputMethod;
     private FlickGestureDetector mGestureDetector;
     private LatinKeyboardView mView;
     private AccessibleKeyboardActionListener mListener;
 
-    private int mScaledEdgeSlop;
     private int mLastHoverKeyIndex = KeyDetector.NOT_A_KEY;
-    private int mLastX = -1;
-    private int mLastY = -1;
 
     public static void init(InputMethodService inputMethod, SharedPreferences prefs) {
         sInstance.initInternal(inputMethod, prefs);
@@ -77,7 +70,6 @@
 
         mInputMethod = inputMethod;
         mGestureDetector = new KeyboardFlickGestureDetector(inputMethod);
-        mScaledEdgeSlop = ViewConfiguration.get(inputMethod).getScaledEdgeSlop();
     }
 
     public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event,
@@ -143,27 +135,10 @@
             if (keyIndex != mLastHoverKeyIndex) {
                 fireKeyHoverEvent(tracker, mLastHoverKeyIndex, false);
                 mLastHoverKeyIndex = keyIndex;
-                mLastX = x;
-                mLastY = y;
                 fireKeyHoverEvent(tracker, mLastHoverKeyIndex, true);
             }
 
             return true;
-        case MotionEventCompatUtils.ACTION_HOVER_EXIT:
-            final int width = mView.getWidth();
-            final int height = mView.getHeight();
-
-            if (x < mScaledEdgeSlop || y < mScaledEdgeSlop || x >= (width - mScaledEdgeSlop)
-                    || y >= (height - mScaledEdgeSlop)) {
-                fireKeyHoverEvent(tracker, mLastHoverKeyIndex, false);
-                mLastHoverKeyIndex = KeyDetector.NOT_A_KEY;
-                mLastX = -1;
-                mLastY = -1;
-            } else if (mLastHoverKeyIndex != KeyDetector.NOT_A_KEY) {
-                fireKeyPressEvent(tracker, mLastX, mLastY, event.getEventTime());
-            }
-
-            return true;
         }
 
         return false;
@@ -197,11 +172,6 @@
         }
     }
 
-    private void fireKeyPressEvent(PointerTracker tracker, int x, int y, long eventTime) {
-        tracker.onDownEvent(x, y, eventTime, mView);
-        tracker.onUpEvent(x, y, eventTime + DELAY_KEY_PRESS);
-    }
-
     private class KeyboardFlickGestureDetector extends FlickGestureDetector {
         public KeyboardFlickGestureDetector(Context context) {
             super(context);
diff --git a/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java b/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java
index a24195e..aab52e1 100644
--- a/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java
@@ -624,16 +624,6 @@
     }
 
     @Override
-    public boolean dispatchTouchEvent(MotionEvent event) {
-        // Drop non-hover touch events when touch exploration is enabled.
-        if (AccessibilityUtils.getInstance().isTouchExplorationEnabled()) {
-            return false;
-        }
-
-        return super.dispatchTouchEvent(event);
-    }
-
-    @Override
     public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {
         if (AccessibilityUtils.getInstance().isTouchExplorationEnabled()) {
             final PointerTracker tracker = getPointerTracker(0);
