diff options
author | 2010-09-07 17:37:15 +0900 | |
---|---|---|
committer | 2010-09-07 17:37:15 +0900 | |
commit | 73540126a8ad99cc368d707a02cc02df3d8d3b1c (patch) | |
tree | c58e21e0ae8a2dadb6a60d175ff2cde0a95c4fa2 /java/src/com/android/inputmethod/latin/PointerTracker.java | |
parent | 41aa5654809db55cefe04105337f84cb8b185b2a (diff) | |
parent | 0415ddde5987a1e30980e300eb2cc36e99734b2e (diff) | |
download | latinime-73540126a8ad99cc368d707a02cc02df3d8d3b1c.tar.gz latinime-73540126a8ad99cc368d707a02cc02df3d8d3b1c.tar.xz latinime-73540126a8ad99cc368d707a02cc02df3d8d3b1c.zip |
Merge remote branch 'goog/master' into merge3
Diffstat (limited to 'java/src/com/android/inputmethod/latin/PointerTracker.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/PointerTracker.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/latin/PointerTracker.java b/java/src/com/android/inputmethod/latin/PointerTracker.java index 1f6005621..f849158ae 100644 --- a/java/src/com/android/inputmethod/latin/PointerTracker.java +++ b/java/src/com/android/inputmethod/latin/PointerTracker.java @@ -65,6 +65,9 @@ public class PointerTracker { // true if event is already translated to a key action (long press or mini-keyboard) private boolean mKeyAlreadyProcessed; + // true if this pointer is repeatable key + private boolean mIsRepeatableKey; + // for move de-bouncing private int mLastCodeX; private int mLastCodeY; @@ -176,6 +179,7 @@ public class PointerTracker { mStartY = y; mDownTime = eventTime; mKeyAlreadyProcessed = false; + mIsRepeatableKey = false; startMoveDebouncing(x, y); startTimeDebouncing(eventTime); checkMultiTap(eventTime, keyIndex); @@ -187,6 +191,7 @@ public class PointerTracker { if (mKeys[keyIndex].repeatable) { repeatKey(keyIndex); mHandler.startKeyRepeatTimer(REPEAT_START_DELAY, keyIndex, this); + mIsRepeatableKey = true; } mHandler.startLongPressTimer(LONGPRESS_TIMEOUT, keyIndex, this); } @@ -246,10 +251,9 @@ public class PointerTracker { return; if (DEBUG) debugLog("onUpEvent :", x, y); - int keyIndex = mKeyDetector.getKeyIndexAndNearbyCodes(x, y, null); - boolean wasInKeyRepeat = mHandler.isInKeyRepeat(); mHandler.cancelKeyTimers(); mHandler.cancelPopupPreview(); + int keyIndex = mKeyDetector.getKeyIndexAndNearbyCodes(x, y, null); if (isMinorMoveBounce(x, y, keyIndex, mCurrentKey)) { updateTimeDebouncing(eventTime); } else { @@ -263,8 +267,7 @@ public class PointerTracker { y = mLastCodeY; } showKeyPreviewAndUpdateKey(NOT_A_KEY); - // If we're not on a repeating key (which sends on a DOWN event) - if (!wasInKeyRepeat) { + if (!mIsRepeatableKey) { detectAndSendKey(mCurrentKey, x, y, eventTime); } if (isValidKeyIndex(keyIndex)) |