From 1645902cce7eaceff4aba3ea01d723240c6ce189 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Wed, 26 Sep 2012 12:46:55 +0900 Subject: [PATCH] Postpone gesture start detection on non-letter key Bug: 7108223 Change-Id: Ie1ead5cec947ddf86c5150dca5b20b224527e511 --- .../com/android/inputmethod/keyboard/PointerTracker.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/java/src/com/android/inputmethod/keyboard/PointerTracker.java b/java/src/com/android/inputmethod/keyboard/PointerTracker.java index d6c567ef7..cfd1e09f9 100644 --- a/java/src/com/android/inputmethod/keyboard/PointerTracker.java +++ b/java/src/com/android/inputmethod/keyboard/PointerTracker.java @@ -560,10 +560,13 @@ public class PointerTracker implements PointerTrackerQueue.Element { return (sPointerTrackerQueue == null) ? 1 : sPointerTrackerQueue.size(); } - private void mayStartBatchInput() { + private void mayStartBatchInput(final Key key) { if (sInGesture || !mGestureStrokeWithPreviewPoints.isStartOfAGesture()) { return; } + if (key == null || !Character.isLetter(key.mCode)) { + return; + } if (DEBUG_LISTENER) { Log.d(TAG, "onStartBatchInput"); } @@ -742,7 +745,7 @@ public class PointerTracker implements PointerTrackerQueue.Element { final int gestureTime = (int)(eventTime - sGestureFirstDownTime); if (mIsDetectingGesture) { mGestureStrokeWithPreviewPoints.addPoint(x, y, gestureTime, isMajorEvent); - mayStartBatchInput(); + mayStartBatchInput(key); if (sInGesture && key != null) { updateBatchInput(eventTime); }