summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--WebCore/platform/android/KeyEventAndroid.cpp136
-rw-r--r--WebKit/android/jni/WebViewCore.cpp4
-rw-r--r--WebKit/android/nav/WebView.cpp12
-rw-r--r--WebKit/android/plugins/ANPKeyCodes.h34
4 files changed, 107 insertions, 79 deletions
diff --git a/WebCore/platform/android/KeyEventAndroid.cpp b/WebCore/platform/android/KeyEventAndroid.cpp
index 09bd0b5..eaf34a9 100644
--- a/WebCore/platform/android/KeyEventAndroid.cpp
+++ b/WebCore/platform/android/KeyEventAndroid.cpp
@@ -42,124 +42,124 @@ static int windowsKeyCodeForKeyEvent(unsigned int keyCode)
{
// Does not provide all key codes, and does not handle all keys.
switch (keyCode) {
- case kKeyCodeDel:
+ case AKEYCODE_DEL:
return VK_BACK;
- case kKeyCodeTab:
+ case AKEYCODE_TAB:
return VK_TAB;
- case kKeyCodeClear:
+ case AKEYCODE_CLEAR:
return VK_CLEAR;
- case kKeyCodeDpadCenter:
- case kKeyCodeNewline:
+ case AKEYCODE_DPAD_CENTER:
+ case AKEYCODE_ENTER:
return VK_RETURN;
- case kKeyCodeShiftLeft:
- case kKeyCodeShiftRight:
+ case AKEYCODE_SHIFT_LEFT:
+ case AKEYCODE_SHIFT_RIGHT:
return VK_SHIFT;
// back will serve as escape, although we probably do not have access to it
- case kKeyCodeBack:
+ case AKEYCODE_BACK:
return VK_ESCAPE;
- case kKeyCodeSpace:
+ case AKEYCODE_SPACE:
return VK_SPACE;
- case kKeyCodeHome:
+ case AKEYCODE_HOME:
return VK_HOME;
- case kKeyCodeDpadLeft:
+ case AKEYCODE_DPAD_LEFT:
return VK_LEFT;
- case kKeyCodeDpadUp:
+ case AKEYCODE_DPAD_UP:
return VK_UP;
- case kKeyCodeDpadRight:
+ case AKEYCODE_DPAD_RIGHT:
return VK_RIGHT;
- case kKeyCodeDpadDown:
+ case AKEYCODE_DPAD_DOWN:
return VK_DOWN;
- case kKeyCode0:
+ case AKEYCODE_0:
return VK_0;
- case kKeyCode1:
+ case AKEYCODE_1:
return VK_1;
- case kKeyCode2:
+ case AKEYCODE_2:
return VK_2;
- case kKeyCode3:
+ case AKEYCODE_3:
return VK_3;
- case kKeyCode4:
+ case AKEYCODE_4:
return VK_4;
- case kKeyCode5:
+ case AKEYCODE_5:
return VK_5;
- case kKeyCode6:
+ case AKEYCODE_6:
return VK_6;
- case kKeyCode7:
+ case AKEYCODE_7:
return VK_7;
- case kKeyCode8:
+ case AKEYCODE_8:
return VK_8;
- case kKeyCode9:
+ case AKEYCODE_9:
return VK_9;
- case kKeyCodeA:
+ case AKEYCODE_A:
return VK_A;
- case kKeyCodeB:
+ case AKEYCODE_B:
return VK_B;
- case kKeyCodeC:
+ case AKEYCODE_C:
return VK_C;
- case kKeyCodeD:
+ case AKEYCODE_D:
return VK_D;
- case kKeyCodeE:
+ case AKEYCODE_E:
return VK_E;
- case kKeyCodeF:
+ case AKEYCODE_F:
return VK_F;
- case kKeyCodeG:
+ case AKEYCODE_G:
return VK_G;
- case kKeyCodeH:
+ case AKEYCODE_H:
return VK_H;
- case kKeyCodeI:
+ case AKEYCODE_I:
return VK_I;
- case kKeyCodeJ:
+ case AKEYCODE_J:
return VK_J;
- case kKeyCodeK:
+ case AKEYCODE_K:
return VK_K;
- case kKeyCodeL:
+ case AKEYCODE_L:
return VK_L;
- case kKeyCodeM:
+ case AKEYCODE_M:
return VK_M;
- case kKeyCodeN:
+ case AKEYCODE_N:
return VK_N;
- case kKeyCodeO:
+ case AKEYCODE_O:
return VK_O;
- case kKeyCodeP:
+ case AKEYCODE_P:
return VK_P;
- case kKeyCodeQ:
+ case AKEYCODE_Q:
return VK_Q;
- case kKeyCodeR:
+ case AKEYCODE_R:
return VK_R;
- case kKeyCodeS:
+ case AKEYCODE_S:
return VK_S;
- case kKeyCodeT:
+ case AKEYCODE_T:
return VK_T;
- case kKeyCodeU:
+ case AKEYCODE_U:
return VK_U;
- case kKeyCodeV:
+ case AKEYCODE_V:
return VK_V;
- case kKeyCodeW:
+ case AKEYCODE_W:
return VK_W;
- case kKeyCodeX:
+ case AKEYCODE_X:
return VK_X;
- case kKeyCodeY:
+ case AKEYCODE_Y:
return VK_Y;
- case kKeyCodeZ:
+ case AKEYCODE_Z:
return VK_Z;
// colon
- case kKeyCodeSemicolon:
+ case AKEYCODE_SEMICOLON:
return VK_OEM_1;
- case kKeyCodeComma:
+ case AKEYCODE_COMMA:
return VK_OEM_COMMA;
- case kKeyCodeMinus:
+ case AKEYCODE_MINUS:
return VK_OEM_MINUS;
- case kKeyCodeEquals:
+ case AKEYCODE_EQUALS:
return VK_OEM_PLUS;
- case kKeyCodePeriod:
+ case AKEYCODE_PERIOD:
return VK_OEM_PERIOD;
- case kKeyCodeSlash:
+ case AKEYCODE_SLASH:
return VK_OEM_2;
// maybe not the right choice
- case kKeyCodeLeftBracket:
+ case AKEYCODE_LEFT_BRACKET:
return VK_OEM_4;
- case kKeyCodeBackslash:
+ case AKEYCODE_BACKSLASH:
return VK_OEM_5;
- case kKeyCodeRightBracket:
+ case AKEYCODE_RIGHT_BRACKET:
return VK_OEM_6;
default:
return 0;
@@ -171,23 +171,23 @@ static String keyIdentifierForAndroidKeyCode(int keyCode)
// Does not return all of the same key identifiers, and
// does not handle all the keys.
switch (keyCode) {
- case kKeyCodeClear:
+ case AKEYCODE_CLEAR:
return "Clear";
- case kKeyCodeNewline:
- case kKeyCodeDpadCenter:
+ case AKEYCODE_ENTER:
+ case AKEYCODE_DPAD_CENTER:
return "Enter";
- case kKeyCodeHome:
+ case AKEYCODE_HOME:
return "Home";
- case kKeyCodeDpadDown:
+ case AKEYCODE_DPAD_DOWN:
return "Down";
- case kKeyCodeDpadLeft:
+ case AKEYCODE_DPAD_LEFT:
return "Left";
- case kKeyCodeDpadRight:
+ case AKEYCODE_DPAD_RIGHT:
return "Right";
- case kKeyCodeDpadUp:
+ case AKEYCODE_DPAD_UP:
return "Up";
// Standard says that DEL becomes U+00007F.
- case kKeyCodeDel:
+ case AKEYCODE_DEL:
return "U+00007F";
default:
char upper[16];
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp
index daca51e..d3e32d3 100644
--- a/WebKit/android/jni/WebViewCore.cpp
+++ b/WebKit/android/jni/WebViewCore.cpp
@@ -1906,8 +1906,8 @@ void WebViewCore::deleteSelection(int start, int end, int textGeneration)
EditorClientAndroid* client = static_cast<EditorClientAndroid*>(
m_mainFrame->editor()->client());
client->setUiGeneratedSelectionChange(true);
- PlatformKeyboardEvent down(kKeyCodeDel, 0, 0, true, false, false, false);
- PlatformKeyboardEvent up(kKeyCodeDel, 0, 0, false, false, false, false);
+ PlatformKeyboardEvent down(AKEYCODE_DEL, 0, 0, true, false, false, false);
+ PlatformKeyboardEvent up(AKEYCODE_DEL, 0, 0, false, false, false, false);
key(down);
key(up);
client->setUiGeneratedSelectionChange(false);
diff --git a/WebKit/android/nav/WebView.cpp b/WebKit/android/nav/WebView.cpp
index ac36b73..5154b42 100644
--- a/WebKit/android/nav/WebView.cpp
+++ b/WebKit/android/nav/WebView.cpp
@@ -657,19 +657,19 @@ void getVisibleRect(WebCore::IntRect* rect)
checkException(env);
}
-static CachedFrame::Direction KeyToDirection(KeyCode keyCode)
+static CachedFrame::Direction KeyToDirection(int32_t keyCode)
{
switch (keyCode) {
- case kKeyCodeDpadRight:
+ case AKEYCODE_DPAD_RIGHT:
DBG_NAV_LOGD("keyCode=%s", "right");
return CachedFrame::RIGHT;
- case kKeyCodeDpadLeft:
+ case AKEYCODE_DPAD_LEFT:
DBG_NAV_LOGD("keyCode=%s", "left");
return CachedFrame::LEFT;
- case kKeyCodeDpadDown:
+ case AKEYCODE_DPAD_DOWN:
DBG_NAV_LOGD("keyCode=%s", "down");
return CachedFrame::DOWN;
- case kKeyCodeDpadUp:
+ case AKEYCODE_DPAD_UP:
DBG_NAV_LOGD("keyCode=%s", "up");
return CachedFrame::UP;
default:
@@ -706,7 +706,7 @@ bool moveCursor(int keyCode, int count, bool ignoreScroll)
}
m_viewImpl->m_moveGeneration++;
- CachedFrame::Direction direction = KeyToDirection((KeyCode) keyCode);
+ CachedFrame::Direction direction = KeyToDirection(keyCode);
const CachedFrame* cachedFrame, * oldFrame = 0;
const CachedNode* cursor = root->currentCursor(&oldFrame);
WebCore::IntPoint cursorLocation = root->cursorLocation();
diff --git a/WebKit/android/plugins/ANPKeyCodes.h b/WebKit/android/plugins/ANPKeyCodes.h
index 328eb56..edfe2b9 100644
--- a/WebKit/android/plugins/ANPKeyCodes.h
+++ b/WebKit/android/plugins/ANPKeyCodes.h
@@ -29,8 +29,7 @@
/* List the key codes that are set to a plugin in the ANPKeyEvent.
These exactly match the values in android/view/KeyEvent.java and the
- corresponding .h file include/ui/KeycodeLabels.h, which contains more than
- I want to publish to plugin authors.
+ corresponding .h file android/keycodes.h.
*/
enum ANPKeyCodes {
kUnknown_ANPKeyCode = 0,
@@ -118,7 +117,36 @@ enum ANPKeyCodes {
kPlus_ANPKeyCode = 81,
kMenu_ANPKeyCode = 82,
kNotification_ANPKeyCode = 83,
- kSearch_ANPKeyCode = 84
+ kSearch_ANPKeyCode = 84,
+ kMediaPlayPause_ANPKeyCode = 85,
+ kMediaStop_ANPKeyCode = 86,
+ kMediaNext_ANPKeyCode = 87,
+ kMediaPrevious_ANPKeyCode = 88,
+ kMediaRewind_ANPKeyCode = 89,
+ kMediaFastForward_ANPKeyCode = 90,
+ kMute_ANPKeyCode = 91,
+ kPageUp_ANPKeyCode = 92,
+ kPageDown_ANPKeyCode = 93,
+ kPictsymbols_ANPKeyCode = 94,
+ kSwitchCharset_ANPKeyCode = 95,
+ kButtonA_ANPKeyCode = 96,
+ kButtonB_ANPKeyCode = 97,
+ kButtonC_ANPKeyCode = 98,
+ kButtonX_ANPKeyCode = 99,
+ kButtonY_ANPKeyCode = 100,
+ kButtonZ_ANPKeyCode = 101,
+ kButtonL1_ANPKeyCode = 102,
+ kButtonR1_ANPKeyCode = 103,
+ kButtonL2_ANPKeyCode = 104,
+ kButtonR2_ANPKeyCode = 105,
+ kButtonThumbL_ANPKeyCode = 106,
+ kButtonThumbR_ANPKeyCode = 107,
+ kButtonStart_ANPKeyCode = 108,
+ kButtonSelect_ANPKeyCode = 109,
+ kButtonMode_ANPKeyCode = 110,
+
+ // NOTE: If you add a new keycode here you must also add it to several other files.
+ // Refer to frameworks/base/core/java/android/view/KeyEvent.java for the full list.
};
#endif