Remove the option to use shift to start selection mode.

Bug:3329956

Also ensure that keys dispatched while the WebTextView
is attached get sent to the WebTextView.

Change-Id: Icd9125a85929089a6f376b71c1cb40e885264168
This commit is contained in:
Leon Scroggins
2011-01-07 14:18:45 -05:00
parent 5c6b786e1c
commit 9cac3c31d2

View File

@ -4564,14 +4564,6 @@ public class WebView extends AbsoluteLayout
return true;
}
if (keyCode == KeyEvent.KEYCODE_SHIFT_LEFT
|| keyCode == KeyEvent.KEYCODE_SHIFT_RIGHT) {
if (!nativePageShouldHandleShiftAndArrows() && !nativeCursorWantsKeyEvents()
&& !mSelectingText) {
setUpSelect();
}
}
if (keyCode == KeyEvent.KEYCODE_PAGE_UP) {
if (event.hasNoModifiers()) {
pageUp(false);
@ -4662,12 +4654,6 @@ public class WebView extends AbsoluteLayout
if (!wantsKeyEvents) return false;
}
if (keyCode != KeyEvent.KEYCODE_SHIFT_LEFT
&& keyCode != KeyEvent.KEYCODE_SHIFT_RIGHT) {
// turn off copy select if a shift-key combo is pressed
selectionDone();
}
if (getSettings().getNavDump()) {
switch (keyCode) {
case KeyEvent.KEYCODE_4:
@ -4766,14 +4752,6 @@ public class WebView extends AbsoluteLayout
return true;
}
if (keyCode == KeyEvent.KEYCODE_SHIFT_LEFT
|| keyCode == KeyEvent.KEYCODE_SHIFT_RIGHT) {
if (!nativePageShouldHandleShiftAndArrows() && copySelection()) {
selectionDone();
return true;
}
}
if (keyCode >= KeyEvent.KEYCODE_DPAD_UP
&& keyCode <= KeyEvent.KEYCODE_DPAD_RIGHT) {
if (nativePageShouldHandleShiftAndArrows()) {
@ -5234,7 +5212,8 @@ public class WebView extends AbsoluteLayout
// Textfields, plugins, and contentEditable nodes need to receive the
// shift up key even if another key was released while the shift key
// was held down.
if (!inEditingMode() && (mNativeClass == 0
boolean inEditingMode = inEditingMode();
if (!inEditingMode && (mNativeClass == 0
|| !nativePageShouldHandleShiftAndArrows())) {
if (event.getAction() == KeyEvent.ACTION_DOWN) {
mGotKeyDown = true;
@ -5251,7 +5230,13 @@ public class WebView extends AbsoluteLayout
}
if (dispatch) {
return super.dispatchKeyEvent(event);
if (inEditingMode) {
// Ensure that the WebTextView gets the event, even if it does
// not currently have a bounds.
return mWebTextView.dispatchKeyEvent(event);
} else {
return super.dispatchKeyEvent(event);
}
} else {
// We didn't dispatch, so let something else handle the key
return false;