aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2010-08-25 20:06:37 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-08-25 20:06:37 -0700
commit0a9ea46c2a8a438de13016d60ceccb96f81eb4d5 (patch)
treeca8a6d1a2e878818fe3179293f2c79a661cdf93b /java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java
parent47db8fe121a3ba439bd192f6fb318792719e4a68 (diff)
parent0d098c514eac2da144dcb856d9aa870bbe5be8c8 (diff)
downloadlatinime-0a9ea46c2a8a438de13016d60ceccb96f81eb4d5.tar.gz
latinime-0a9ea46c2a8a438de13016d60ceccb96f81eb4d5.tar.xz
latinime-0a9ea46c2a8a438de13016d60ceccb96f81eb4d5.zip
am 0d098c51: Fix bugs in key repeat logic
Merge commit '0d098c514eac2da144dcb856d9aa870bbe5be8c8' into gingerbread-plus-aosp * commit '0d098c514eac2da144dcb856d9aa870bbe5be8c8': Fix bugs in key repeat logic
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java14
1 files changed, 8 insertions, 6 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java b/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java
index 433705995..8e55c8e3c 100644
--- a/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java
+++ b/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java
@@ -1313,13 +1313,14 @@ public class LatinKeyboardBaseView extends View implements View.OnClickListener
}
if (mHandler.isInKeyRepeat()) {
- // Will keep being in the key repeating mode while the key is being pressed. It'll be
- // canceled otherwise.
- if (pointerCount == 1 && action == MotionEvent.ACTION_MOVE) {
- return true;
- } else {
+ // It'll be canceled if 2 or more keys are in action. Otherwise it will keep being in
+ // the key repeating mode while the key is being pressed.
+ if (pointerCount > 1) {
mHandler.cancelKeyRepeatTimer();
+ } else if (action == MotionEvent.ACTION_MOVE) {
+ return true;
}
+ // Up event will pass through.
}
if (pointerCount != mOldPointerCount) {
@@ -1415,6 +1416,7 @@ public class LatinKeyboardBaseView extends View implements View.OnClickListener
break;
case MotionEvent.ACTION_UP:
+ boolean wasInKeyRepeat = mHandler.isInKeyRepeat();
mHandler.cancelKeyTimers();
mHandler.cancelPopupPreview();
if (mDebouncer.isMinorMoveBounce(touchX, touchY, keyIndex, mCurrentKey)) {
@@ -1431,7 +1433,7 @@ public class LatinKeyboardBaseView extends View implements View.OnClickListener
}
showPreview(NOT_A_KEY);
// If we're not on a repeating key (which sends on a DOWN event)
- if (!mMiniKeyboardOnScreen && !mAbortKey) {
+ if (!wasInKeyRepeat && !mMiniKeyboardOnScreen && !mAbortKey) {
detectAndSendKey(mCurrentKey, touchX, touchY, eventTime);
}
invalidateKey(keyIndex);