diff options
author | 2012-07-26 02:13:19 -0700 | |
---|---|---|
committer | 2012-07-26 02:13:20 -0700 | |
commit | e863fb712fc6886e8eef345c3c45c21396a89cbf (patch) | |
tree | 7dd5bdb52689df0476680ac340c0ff3b244edf12 /java/src | |
parent | b90363e40cedcc75537f4c3c6ad378902ffa3ddf (diff) | |
parent | c902dfeb8f8b889e885565a000556419e0d8307f (diff) | |
download | latinime-e863fb712fc6886e8eef345c3c45c21396a89cbf.tar.gz latinime-e863fb712fc6886e8eef345c3c45c21396a89cbf.tar.xz latinime-e863fb712fc6886e8eef345c3c45c21396a89cbf.zip |
Merge "Fix gesture detection when sliding key input is disabled"
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/keyboard/PointerTracker.java | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/PointerTracker.java b/java/src/com/android/inputmethod/keyboard/PointerTracker.java index 67857d111..bd896517b 100644 --- a/java/src/com/android/inputmethod/keyboard/PointerTracker.java +++ b/java/src/com/android/inputmethod/keyboard/PointerTracker.java @@ -794,13 +794,16 @@ public class PointerTracker { final int dx = x - lastX; final int dy = y - lastY; final int lastMoveSquared = dx * dx + dy * dy; + // TODO: Should find a way to balance gesture detection and this hack. if (sNeedsPhantomSuddenMoveEventHack - && lastMoveSquared >= mKeyQuarterWidthSquared) { + && lastMoveSquared >= mKeyQuarterWidthSquared + && !mIsPossibleGesture) { if (DEBUG_MODE) { Log.w(TAG, String.format("onMoveEvent:" + " phantom sudden move event is translated to " + "up[%d,%d]/down[%d,%d] events", lastX, lastY, x, y)); } + // TODO: This should be moved to outside of this nested if-clause? if (ProductionFlag.IS_EXPERIMENTAL) { ResearchLogger.pointerTracker_onMoveEvent(x, y, lastX, lastY); } @@ -816,7 +819,9 @@ public class PointerTracker { && !sPointerTrackerQueue.hasModifierKeyOlderThan(this)) { onUpEventInternal(x, y, eventTime); } - mKeyAlreadyProcessed = true; + if (!mIsPossibleGesture) { + mKeyAlreadyProcessed = true; + } setReleasedKeyGraphics(oldKey); } } @@ -832,7 +837,9 @@ public class PointerTracker { if (mIsAllowedSlidingKeyInput) { onMoveToNewKey(key, x, y); } else { - mKeyAlreadyProcessed = true; + if (!mIsPossibleGesture) { + mKeyAlreadyProcessed = true; + } } } } @@ -871,6 +878,7 @@ public class PointerTracker { private void onUpEventInternal(int x, int y, long eventTime) { mTimerProxy.cancelKeyTimers(); mIsInSlidingKeyInput = false; + mIsPossibleGesture = false; // Release the last pressed key. setReleasedKeyGraphics(mCurrentKey); if (mIsShowingMoreKeysPanel) { |