Set mShiftIsPressed properly when the focus is a plugin.

Fix for http://b/issue?id=2484986

Change-Id: I3140c3c3a0bd44af85939aceb0bbd07c0861cde4
This commit is contained in:
Leon Scroggins
2010-03-09 14:26:07 -05:00
parent f53774bce6
commit 7a37587664

View File

@@ -3691,11 +3691,13 @@ public class WebView extends AbsoluteLayout
return false;
}
if (mShiftIsPressed == false && nativeCursorWantsKeyEvents() == false
&& !nativeFocusIsPlugin()
&& (keyCode == KeyEvent.KEYCODE_SHIFT_LEFT
|| keyCode == KeyEvent.KEYCODE_SHIFT_RIGHT)) {
setUpSelectXY();
if (keyCode == KeyEvent.KEYCODE_SHIFT_LEFT
|| keyCode == KeyEvent.KEYCODE_SHIFT_RIGHT) {
if (nativeFocusIsPlugin()) {
mShiftIsPressed = true;
} else if (!nativeCursorWantsKeyEvents() && !mShiftIsPressed) {
setUpSelectXY();
}
}
if (keyCode >= KeyEvent.KEYCODE_DPAD_UP
@@ -3834,7 +3836,10 @@ public class WebView extends AbsoluteLayout
if (keyCode == KeyEvent.KEYCODE_SHIFT_LEFT
|| keyCode == KeyEvent.KEYCODE_SHIFT_RIGHT) {
if (commitCopy()) {
if (nativeFocusIsPlugin()) {
mShiftIsPressed = false;
return true;
} else if (commitCopy()) {
return true;
}
}
@@ -4195,7 +4200,9 @@ public class WebView extends AbsoluteLayout
public boolean dispatchKeyEvent(KeyEvent event) {
boolean dispatch = true;
if (!inEditingMode()) {
// Textfields and plugins need to receive the shift up key even if
// another key was released while the shift key was held down.
if (!inEditingMode() && !nativeFocusIsPlugin()) {
if (event.getAction() == KeyEvent.ACTION_DOWN) {
mGotKeyDown = true;
} else {