diff options
| author | Amith Yamasani <yamasani@google.com> | 2009-08-19 20:05:43 -0700 |
|---|---|---|
| committer | Amith Yamasani <yamasani@google.com> | 2009-08-19 20:05:43 -0700 |
| commit | 8b37eb0c2a94d32c012a2709ddb0effc985b1d65 (patch) | |
| tree | 7eb3c9ceb939c028468cbe47b5258f209125c587 /core/java/android/inputmethodservice | |
| parent | f768d24f7d9c01d1e01fdbccc3adc75fda3f8d4b (diff) | |
| download | frameworks_base-8b37eb0c2a94d32c012a2709ddb0effc985b1d65.zip frameworks_base-8b37eb0c2a94d32c012a2709ddb0effc985b1d65.tar.gz frameworks_base-8b37eb0c2a94d32c012a2709ddb0effc985b1d65.tar.bz2 | |
Fix bug 2045914: When pressing 2 keys, sometimes the second key gets stuck.
Also lock repeatable keys so that you don't get space and 'v', for example,
when you move just a little bit off the spacebar.
Diffstat (limited to 'core/java/android/inputmethodservice')
| -rwxr-xr-x | core/java/android/inputmethodservice/KeyboardView.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/core/java/android/inputmethodservice/KeyboardView.java b/core/java/android/inputmethodservice/KeyboardView.java index 9e966cd..a141a2a 100755 --- a/core/java/android/inputmethodservice/KeyboardView.java +++ b/core/java/android/inputmethodservice/KeyboardView.java @@ -1037,6 +1037,10 @@ public class KeyboardView extends View implements View.OnClickListener { me.getX(), me.getY(), me.getMetaState()); result = onModifiedTouchEvent(down); down.recycle(); + // If it's an up action, then deliver the up as well. + if (me.getAction() == MotionEvent.ACTION_UP) { + result = onModifiedTouchEvent(me); + } } else { // Send an up event for the last pointer MotionEvent up = MotionEvent.obtain(now, now, MotionEvent.ACTION_UP, @@ -1067,7 +1071,7 @@ public class KeyboardView extends View implements View.OnClickListener { if (mGestureDetector.onTouchEvent(me)) { showPreview(NOT_A_KEY); mHandler.removeMessages(MSG_REPEAT); - mHandler.removeMessages(MSG_LONGPRESS); + mHandler.removeMessages(MSG_LONGPRESS); return true; } @@ -1116,7 +1120,7 @@ public class KeyboardView extends View implements View.OnClickListener { if (keyIndex == mCurrentKey) { mCurrentKeyTime += eventTime - mLastMoveTime; continueLongPress = true; - } else { + } else if (mRepeatKeyIndex == NOT_A_KEY) { resetMultiTap(); mLastKey = mCurrentKey; mLastCodeX = mLastX; @@ -1127,10 +1131,6 @@ public class KeyboardView extends View implements View.OnClickListener { mCurrentKeyTime = 0; } } - if (keyIndex != mRepeatKeyIndex) { - mHandler.removeMessages(MSG_REPEAT); - mRepeatKeyIndex = NOT_A_KEY; - } } if (!continueLongPress) { // Cancel old longpress @@ -1141,7 +1141,7 @@ public class KeyboardView extends View implements View.OnClickListener { mHandler.sendMessageDelayed(msg, LONGPRESS_TIMEOUT); } } - showPreview(keyIndex); + showPreview(mCurrentKey); break; case MotionEvent.ACTION_UP: |
