Merge change 22045 into eclair
* changes: Fix bug 2045914: When pressing 2 keys, sometimes the second key gets stuck.
This commit is contained in:
@@ -1037,6 +1037,10 @@ public class KeyboardView extends View implements View.OnClickListener {
|
|||||||
me.getX(), me.getY(), me.getMetaState());
|
me.getX(), me.getY(), me.getMetaState());
|
||||||
result = onModifiedTouchEvent(down);
|
result = onModifiedTouchEvent(down);
|
||||||
down.recycle();
|
down.recycle();
|
||||||
|
// If it's an up action, then deliver the up as well.
|
||||||
|
if (me.getAction() == MotionEvent.ACTION_UP) {
|
||||||
|
result = onModifiedTouchEvent(me);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// Send an up event for the last pointer
|
// Send an up event for the last pointer
|
||||||
MotionEvent up = MotionEvent.obtain(now, now, MotionEvent.ACTION_UP,
|
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)) {
|
if (mGestureDetector.onTouchEvent(me)) {
|
||||||
showPreview(NOT_A_KEY);
|
showPreview(NOT_A_KEY);
|
||||||
mHandler.removeMessages(MSG_REPEAT);
|
mHandler.removeMessages(MSG_REPEAT);
|
||||||
mHandler.removeMessages(MSG_LONGPRESS);
|
mHandler.removeMessages(MSG_LONGPRESS);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1116,7 +1120,7 @@ public class KeyboardView extends View implements View.OnClickListener {
|
|||||||
if (keyIndex == mCurrentKey) {
|
if (keyIndex == mCurrentKey) {
|
||||||
mCurrentKeyTime += eventTime - mLastMoveTime;
|
mCurrentKeyTime += eventTime - mLastMoveTime;
|
||||||
continueLongPress = true;
|
continueLongPress = true;
|
||||||
} else {
|
} else if (mRepeatKeyIndex == NOT_A_KEY) {
|
||||||
resetMultiTap();
|
resetMultiTap();
|
||||||
mLastKey = mCurrentKey;
|
mLastKey = mCurrentKey;
|
||||||
mLastCodeX = mLastX;
|
mLastCodeX = mLastX;
|
||||||
@@ -1127,10 +1131,6 @@ public class KeyboardView extends View implements View.OnClickListener {
|
|||||||
mCurrentKeyTime = 0;
|
mCurrentKeyTime = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (keyIndex != mRepeatKeyIndex) {
|
|
||||||
mHandler.removeMessages(MSG_REPEAT);
|
|
||||||
mRepeatKeyIndex = NOT_A_KEY;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (!continueLongPress) {
|
if (!continueLongPress) {
|
||||||
// Cancel old longpress
|
// Cancel old longpress
|
||||||
@@ -1141,7 +1141,7 @@ public class KeyboardView extends View implements View.OnClickListener {
|
|||||||
mHandler.sendMessageDelayed(msg, LONGPRESS_TIMEOUT);
|
mHandler.sendMessageDelayed(msg, LONGPRESS_TIMEOUT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
showPreview(keyIndex);
|
showPreview(mCurrentKey);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MotionEvent.ACTION_UP:
|
case MotionEvent.ACTION_UP:
|
||||||
|
|||||||
Reference in New Issue
Block a user