Merge "map keyboard for webview"
This commit is contained in:
@@ -238,7 +238,8 @@ import junit.framework.Assert;
|
||||
}
|
||||
}
|
||||
|
||||
if ((mSingle && KeyEvent.KEYCODE_ENTER == keyCode)) {
|
||||
if (mSingle && (KeyEvent.KEYCODE_ENTER == keyCode
|
||||
|| KeyEvent.KEYCODE_NUMPAD_ENTER == keyCode)) {
|
||||
if (isPopupShowing()) {
|
||||
return super.dispatchKeyEvent(event);
|
||||
}
|
||||
@@ -296,7 +297,8 @@ import junit.framework.Assert;
|
||||
// so do not pass down to javascript, and instead
|
||||
// return true. If it is an arrow key or a delete key, we can go
|
||||
// ahead and pass it down.
|
||||
if (KeyEvent.KEYCODE_ENTER == keyCode) {
|
||||
if (KeyEvent.KEYCODE_ENTER == keyCode
|
||||
|| KeyEvent.KEYCODE_NUMPAD_ENTER == keyCode) {
|
||||
// For multi-line text boxes, newlines will
|
||||
// trigger onTextChanged for key down (which will send both
|
||||
// key up and key down) but not key up.
|
||||
|
||||
@@ -4471,10 +4471,17 @@ public class WebView extends AbsoluteLayout
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean isEnterActionKey(int keyCode) {
|
||||
return keyCode == KeyEvent.KEYCODE_DPAD_CENTER
|
||||
|| keyCode == KeyEvent.KEYCODE_ENTER
|
||||
|| keyCode == KeyEvent.KEYCODE_NUMPAD_ENTER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
if (DebugFlags.WEB_VIEW) {
|
||||
Log.v(LOGTAG, "keyDown at " + System.currentTimeMillis()
|
||||
+ "keyCode=" + keyCode
|
||||
+ ", " + event + ", unicode=" + event.getUnicodeChar());
|
||||
}
|
||||
|
||||
@@ -4543,7 +4550,7 @@ public class WebView extends AbsoluteLayout
|
||||
return false;
|
||||
}
|
||||
|
||||
if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER) {
|
||||
if (isEnterActionKey(keyCode)) {
|
||||
switchOutDrawHistory();
|
||||
if (event.getRepeatCount() == 0) {
|
||||
if (mSelectingText) {
|
||||
@@ -4672,7 +4679,7 @@ public class WebView extends AbsoluteLayout
|
||||
return false;
|
||||
}
|
||||
|
||||
if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER) {
|
||||
if (isEnterActionKey(keyCode)) {
|
||||
// remove the long press message first
|
||||
mPrivateHandler.removeMessages(LONG_PRESS_CENTER);
|
||||
mGotCenterDown = false;
|
||||
@@ -5464,8 +5471,10 @@ public class WebView extends AbsoluteLayout
|
||||
} else {
|
||||
// TODO: allow scrollable overflow div to autoscroll
|
||||
}
|
||||
nativeExtendSelection(contentX, contentY);
|
||||
invalidate();
|
||||
if (deltaX != 0 || deltaY != 0) {
|
||||
nativeExtendSelection(contentX, contentY);
|
||||
invalidate();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user