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:
@ -4564,14 +4564,6 @@ public class WebView extends AbsoluteLayout
|
|||||||
return true;
|
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 (keyCode == KeyEvent.KEYCODE_PAGE_UP) {
|
||||||
if (event.hasNoModifiers()) {
|
if (event.hasNoModifiers()) {
|
||||||
pageUp(false);
|
pageUp(false);
|
||||||
@ -4662,12 +4654,6 @@ public class WebView extends AbsoluteLayout
|
|||||||
if (!wantsKeyEvents) return false;
|
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()) {
|
if (getSettings().getNavDump()) {
|
||||||
switch (keyCode) {
|
switch (keyCode) {
|
||||||
case KeyEvent.KEYCODE_4:
|
case KeyEvent.KEYCODE_4:
|
||||||
@ -4766,14 +4752,6 @@ public class WebView extends AbsoluteLayout
|
|||||||
return true;
|
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
|
if (keyCode >= KeyEvent.KEYCODE_DPAD_UP
|
||||||
&& keyCode <= KeyEvent.KEYCODE_DPAD_RIGHT) {
|
&& keyCode <= KeyEvent.KEYCODE_DPAD_RIGHT) {
|
||||||
if (nativePageShouldHandleShiftAndArrows()) {
|
if (nativePageShouldHandleShiftAndArrows()) {
|
||||||
@ -5234,7 +5212,8 @@ public class WebView extends AbsoluteLayout
|
|||||||
// Textfields, plugins, and contentEditable nodes need to receive the
|
// Textfields, plugins, and contentEditable nodes need to receive the
|
||||||
// shift up key even if another key was released while the shift key
|
// shift up key even if another key was released while the shift key
|
||||||
// was held down.
|
// was held down.
|
||||||
if (!inEditingMode() && (mNativeClass == 0
|
boolean inEditingMode = inEditingMode();
|
||||||
|
if (!inEditingMode && (mNativeClass == 0
|
||||||
|| !nativePageShouldHandleShiftAndArrows())) {
|
|| !nativePageShouldHandleShiftAndArrows())) {
|
||||||
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||||
mGotKeyDown = true;
|
mGotKeyDown = true;
|
||||||
@ -5251,7 +5230,13 @@ public class WebView extends AbsoluteLayout
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (dispatch) {
|
if (dispatch) {
|
||||||
|
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);
|
return super.dispatchKeyEvent(event);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// We didn't dispatch, so let something else handle the key
|
// We didn't dispatch, so let something else handle the key
|
||||||
return false;
|
return false;
|
||||||
|
Reference in New Issue
Block a user