Chromium Code Reviews| Index: Source/core/events/KeyboardEvent.cpp |
| diff --git a/Source/core/events/KeyboardEvent.cpp b/Source/core/events/KeyboardEvent.cpp |
| index ac7ae1f7ad51bd6b10b7387839bb4dd0d16d4968..98e70ab4f99523737fa576b7f267a2ed1dd2f89f 100644 |
| --- a/Source/core/events/KeyboardEvent.cpp |
| +++ b/Source/core/events/KeyboardEvent.cpp |
| @@ -28,6 +28,14 @@ |
| namespace blink { |
| +namespace { |
| + |
| +#if OS(ANDROID) |
| +int kInputMethodEditorCompositionKeyCode = 229; |
|
bcwhite
2015/01/12 21:02:44
Is this constant available anywhere else already o
huangs
2015/01/12 23:25:57
Searched for 229 and 0xE5. Something close is
ht
|
| +#endif |
| + |
| +} // namespace |
| + |
| static inline const AtomicString& eventTypeForKeyboardEventType(PlatformEvent::Type type) |
| { |
| switch (type) { |
| @@ -163,6 +171,13 @@ int KeyboardEvent::keyCode() const |
| // We match IE. |
| if (!m_keyEvent) |
| return 0; |
| + |
| +#if OS(ANDROID) |
|
bcwhite
2015/01/12 21:02:44
// TODO: Check if this applies to other OS
huangs
2015/01/12 23:25:57
Done (using FIXME instead).
|
| + // If the key event belongs to IME composition then propagate to JS. |
| + if (m_keyEvent->nativeVirtualKeyCode() == kInputMethodEditorCompositionKeyCode) |
| + return kInputMethodEditorCompositionKeyCode; |
| +#endif |
| + |
| if (type() == EventTypeNames::keydown || type() == EventTypeNames::keyup) |
| return windowsVirtualKeyCodeWithoutLocation(m_keyEvent->windowsVirtualKeyCode()); |