am 73ef5d4e: DO NOT MERGE. CHERRY-PICKED GERRIT CHANGE 60365.
Merge commit '73ef5d4e2bcbf28ccb84580439f2f79d5cea1ec7' into gingerbread-plus-aosp * commit '73ef5d4e2bcbf28ccb84580439f2f79d5cea1ec7': DO NOT MERGE. CHERRY-PICKED GERRIT CHANGE 60365.
This commit is contained in:
@@ -3911,6 +3911,19 @@ public class WebView extends AbsoluteLayout
|
||||
// affect long press with the trackball/touch.
|
||||
private boolean mGotCenterDown = false;
|
||||
|
||||
@Override
|
||||
public boolean onKeyMultiple(int keyCode, int repeatCount, KeyEvent event) {
|
||||
// send complex characters to webkit for use by JS and plugins
|
||||
if (keyCode == KeyEvent.KEYCODE_UNKNOWN && event.getCharacters() != null) {
|
||||
// pass the key to DOM
|
||||
mWebViewCore.sendMessage(EventHub.KEY_DOWN, event);
|
||||
mWebViewCore.sendMessage(EventHub.KEY_UP, event);
|
||||
// return true as DOM handles the key
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
if (DebugFlags.WEB_VIEW) {
|
||||
|
||||
@@ -1568,9 +1568,16 @@ final class WebViewCore {
|
||||
+ evt);
|
||||
}
|
||||
int keyCode = evt.getKeyCode();
|
||||
if (!nativeKey(keyCode, evt.getUnicodeChar(),
|
||||
evt.getRepeatCount(), evt.isShiftPressed(), evt.isAltPressed(),
|
||||
evt.isSymPressed(),
|
||||
int unicodeChar = evt.getUnicodeChar();
|
||||
|
||||
if (keyCode == KeyEvent.KEYCODE_UNKNOWN && evt.getCharacters() != null
|
||||
&& evt.getCharacters().length() > 0) {
|
||||
// we should only receive individual complex characters
|
||||
unicodeChar = evt.getCharacters().codePointAt(0);
|
||||
}
|
||||
|
||||
if (!nativeKey(keyCode, unicodeChar, evt.getRepeatCount(), evt.isShiftPressed(),
|
||||
evt.isAltPressed(), evt.isSymPressed(),
|
||||
isDown) && keyCode != KeyEvent.KEYCODE_ENTER) {
|
||||
if (keyCode >= KeyEvent.KEYCODE_DPAD_UP
|
||||
&& keyCode <= KeyEvent.KEYCODE_DPAD_RIGHT) {
|
||||
|
||||
Reference in New Issue
Block a user