diff options
author | Cary Clark <cary@android.com> | 2009-06-26 14:29:51 -0400 |
---|---|---|
committer | Cary Clark <cary@android.com> | 2009-06-29 08:20:09 -0400 |
commit | b6631b666120e63a9ceee4a77613cf962fa37b1f (patch) | |
tree | f6d2e38213df23f732bb5c6c27b6e124438eeeb2 /WebCore/platform | |
parent | af20123d135af00dd2762754671d88e4d52122c8 (diff) | |
download | external_webkit-b6631b666120e63a9ceee4a77613cf962fa37b1f.zip external_webkit-b6631b666120e63a9ceee4a77613cf962fa37b1f.tar.gz external_webkit-b6631b666120e63a9ceee4a77613cf962fa37b1f.tar.bz2 |
work in progress to enable plugins to receive arrow keys
Consolidate key handling. Simplify interface between android
and webkit so multiple clients can use common code to pass keys.
Add helper to return if cached node is plugin.
Use WebView::m_clickedOnPlugin to remember active plugins.
Add WebView.MOVE_CURSOR to replay key events the plugin
doesn't want.
Diffstat (limited to 'WebCore/platform')
-rw-r--r-- | WebCore/platform/PlatformKeyboardEvent.h | 4 | ||||
-rw-r--r-- | WebCore/platform/android/KeyEventAndroid.cpp | 13 |
2 files changed, 8 insertions, 9 deletions
diff --git a/WebCore/platform/PlatformKeyboardEvent.h b/WebCore/platform/PlatformKeyboardEvent.h index 34c05fe..75922fa 100644 --- a/WebCore/platform/PlatformKeyboardEvent.h +++ b/WebCore/platform/PlatformKeyboardEvent.h @@ -140,8 +140,8 @@ namespace WebCore { #endif #if PLATFORM(ANDROID) - PlatformKeyboardEvent(int keyCode, UChar32 unichar, Type, - int repeatCount, ModifierKey); + PlatformKeyboardEvent(int keyCode, UChar32 unichar, int repeatCount, + bool down, bool cap, bool alt, bool sym); UChar32 unichar() const { return m_unichar; } int repeatCount() const { return m_repeatCount; } #endif diff --git a/WebCore/platform/android/KeyEventAndroid.cpp b/WebCore/platform/android/KeyEventAndroid.cpp index ab848bd..998c781 100644 --- a/WebCore/platform/android/KeyEventAndroid.cpp +++ b/WebCore/platform/android/KeyEventAndroid.cpp @@ -211,9 +211,8 @@ static inline String singleCharacterString(UChar32 c) } PlatformKeyboardEvent::PlatformKeyboardEvent(int keyCode, UChar32 unichar, - Type type, int repeatCount, - ModifierKey mods) - : m_type(type) + int repeatCount, bool down, bool cap, bool alt, bool sym) + : m_type(down ? KeyDown : KeyUp) , m_text(singleCharacterString(unichar)) , m_unmodifiedText(singleCharacterString(unichar)) , m_keyIdentifier(keyIdentifierForAndroidKeyCode(keyCode)) @@ -221,10 +220,10 @@ PlatformKeyboardEvent::PlatformKeyboardEvent(int keyCode, UChar32 unichar, , m_windowsVirtualKeyCode(windowsKeyCodeForKeyEvent(keyCode)) , m_nativeVirtualKeyCode(keyCode) , m_isKeypad(false) - , m_shiftKey((mods & ShiftKey)) - , m_ctrlKey((mods & CtrlKey)) - , m_altKey((mods & AltKey)) - , m_metaKey((mods & MetaKey)) + , m_shiftKey(cap ? ShiftKey : 0) + , m_ctrlKey(sym ? CtrlKey : 0) + , m_altKey(alt ? AltKey : 0) + , m_metaKey(0) // added for android , m_repeatCount(repeatCount) , m_unichar(unichar) |