diff options
author | Ben Murdoch <benm@google.com> | 2010-02-02 20:36:35 +0000 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-02-19 11:46:26 +0000 |
commit | ff38e49a48fa4d5f7810ce815794d262dabf5183 (patch) | |
tree | 3d47f09135a686e00285309ce6b556cbad3ee993 /WebCore/platform/android/PlatformTouchEventAndroid.cpp | |
parent | 74d23f79f073f0f0c3d925d9cf2749cef827130c (diff) | |
download | external_webkit-ff38e49a48fa4d5f7810ce815794d262dabf5183.zip external_webkit-ff38e49a48fa4d5f7810ce815794d262dabf5183.tar.gz external_webkit-ff38e49a48fa4d5f7810ce815794d262dabf5183.tar.bz2 |
Add support for setting key states with touch events on Android.
Properly guard non-upstreamed common code.
Change-Id: I109dbe97d8c96efe3660ce3893a4e730927e90ef
Diffstat (limited to 'WebCore/platform/android/PlatformTouchEventAndroid.cpp')
-rw-r--r-- | WebCore/platform/android/PlatformTouchEventAndroid.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/WebCore/platform/android/PlatformTouchEventAndroid.cpp b/WebCore/platform/android/PlatformTouchEventAndroid.cpp index d2fcebb..085eb0a 100644 --- a/WebCore/platform/android/PlatformTouchEventAndroid.cpp +++ b/WebCore/platform/android/PlatformTouchEventAndroid.cpp @@ -30,16 +30,26 @@ namespace WebCore { -// TODO (benm): eventTime is new and needs to be upstream -PlatformTouchEvent::PlatformTouchEvent(const IntPoint& windowPos, TouchEventType type, PlatformTouchPoint::State state, long eventTime) +// TODO(benm): This enum needs upstreaming. +// These values should be kept in sync with those defined in the android.view.KeyEvent class from the Android SDK. +enum AndroidMetaKeyState { + META_SHIFT_ON = 0x01, + META_ALT_ON = 0x02, + META_SYM_ON = 0x04 +}; + +// TODO (benm): eventTime and metaState are new and needs to be upstreamed. +PlatformTouchEvent::PlatformTouchEvent(const IntPoint& windowPos, TouchEventType type, PlatformTouchPoint::State state, long eventTime, int metaState) : m_type(type) - , m_ctrlKey(false) - , m_altKey(false) - , m_shiftKey(false) , m_metaKey(false) , m_eventTime(eventTime) { m_touchPoints.append(PlatformTouchPoint(windowPos, state)); + + // TODO(benm): metaState needs upstreaming. + m_altKey = metaState & META_ALT_ON; + m_shiftKey = metaState & META_SHIFT_ON; + m_ctrlKey = metaState & META_SYM_ON; } } |