diff options
author | 2010-12-05 18:20:43 -0800 | |
---|---|---|
committer | 2010-12-05 18:20:43 -0800 | |
commit | 44aeff2b5ce81c23495f982102c35abd2dab969a (patch) | |
tree | 6531fc021dadb459827678fe5e00856ce7db9df5 /java/src | |
parent | 6f6c90bd296c6d76f0cfa9f8b996aa37dd0ca086 (diff) | |
parent | e75e00d898bd38301761e674eee5dfb5bb6d9c87 (diff) | |
download | latinime-44aeff2b5ce81c23495f982102c35abd2dab969a.tar.gz latinime-44aeff2b5ce81c23495f982102c35abd2dab969a.tar.xz latinime-44aeff2b5ce81c23495f982102c35abd2dab969a.zip |
am e75e00d8: Merge "Key release event should be sent when finger sliding (DO NOT MERGE)" into gingerbread
* commit 'e75e00d898bd38301761e674eee5dfb5bb6d9c87':
Key release event should be sent when finger sliding (DO NOT MERGE)
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/PointerTracker.java | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/latin/PointerTracker.java b/java/src/com/android/inputmethod/latin/PointerTracker.java index f6fd5bd7a..90218e4ab 100644 --- a/java/src/com/android/inputmethod/latin/PointerTracker.java +++ b/java/src/com/android/inputmethod/latin/PointerTracker.java @@ -296,18 +296,23 @@ public class PointerTracker { if (mKeyAlreadyProcessed) return; KeyState keyState = mKeyState; - int keyIndex = keyState.onMoveKey(x, y); + final int keyIndex = keyState.onMoveKey(x, y); + final Key oldKey = getKey(keyState.getKeyIndex()); if (isValidKeyIndex(keyIndex)) { - if (keyState.getKeyIndex() == NOT_A_KEY) { + if (oldKey == null) { keyState.onMoveToNewKey(keyIndex, x, y); mHandler.startLongPressTimer(mLongPressKeyTimeout, keyIndex, this); } else if (!isMinorMoveBounce(x, y, keyIndex)) { + if (mListener != null) + mListener.onRelease(oldKey.codes[0]); resetMultiTap(); keyState.onMoveToNewKey(keyIndex, x, y); mHandler.startLongPressTimer(mLongPressKeyTimeout, keyIndex, this); } } else { - if (keyState.getKeyIndex() != NOT_A_KEY) { + if (oldKey != null) { + if (mListener != null) + mListener.onRelease(oldKey.codes[0]); keyState.onMoveToNewKey(keyIndex, x ,y); mHandler.cancelLongPressTimer(); } else if (!isMinorMoveBounce(x, y, keyIndex)) { @@ -411,7 +416,7 @@ public class PointerTracker { private void showKeyPreviewAndUpdateKey(int keyIndex) { updateKey(keyIndex); // The modifier key, such as shift key, should not be shown as preview when multi-touch is - // supported. On thge other hand, if multi-touch is not supported, the modifier key should + // supported. On the other hand, if multi-touch is not supported, the modifier key should // be shown as preview. if (mHasDistinctMultitouch && isModifier()) { mProxy.showPreview(NOT_A_KEY, this); |