summaryrefslogtreecommitdiffstats
path: root/libs/ui/Input.cpp
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2010-07-15 17:44:53 -0700
committerDianne Hackborn <hackbod@google.com>2010-07-15 22:05:33 -0700
commit0e8852766d2cc0ef82ed0846a4cae55ead01fdbf (patch)
tree0988f0a07abbfa77cae83931d6f647f5cf532c7a /libs/ui/Input.cpp
parent5c1ed84a2dec7efe914d0d1abb6834f8543fb9f1 (diff)
downloadframeworks_native-0e8852766d2cc0ef82ed0846a4cae55ead01fdbf.zip
frameworks_native-0e8852766d2cc0ef82ed0846a4cae55ead01fdbf.tar.gz
frameworks_native-0e8852766d2cc0ef82ed0846a4cae55ead01fdbf.tar.bz2
Implement native key pre-dispatching to IMEs.
This significantly re-works the native key dispatching code to allow events to be pre-dispatched to the current IME before being processed by native code. It introduces one new public API, which must be called after retrieving an event if the app wishes for it to be pre-dispatched. Currently the native code will only do pre-dispatching of system keys, to avoid significant overhead for gaming input. This should be improved to be smarted, filtering for only keys that the IME is interested in. Unfortunately IMEs don't currently provide this information. :p Change-Id: Ic1c7aeec8b348164957f2cd88119eb5bd85c2a9f
Diffstat (limited to 'libs/ui/Input.cpp')
-rw-r--r--libs/ui/Input.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/libs/ui/Input.cpp b/libs/ui/Input.cpp
index e5f014f..5253c72 100644
--- a/libs/ui/Input.cpp
+++ b/libs/ui/Input.cpp
@@ -18,6 +18,11 @@ void InputEvent::initialize(int32_t deviceId, int32_t source) {
mSource = source;
}
+void InputEvent::initialize(const InputEvent& from) {
+ mDeviceId = from.mDeviceId;
+ mSource = from.mSource;
+}
+
// class KeyEvent
bool KeyEvent::hasDefaultAction(int32_t keyCode) {
@@ -106,6 +111,18 @@ void KeyEvent::initialize(
mEventTime = eventTime;
}
+void KeyEvent::initialize(const KeyEvent& from) {
+ InputEvent::initialize(from);
+ mAction = from.mAction;
+ mFlags = from.mFlags;
+ mKeyCode = from.mKeyCode;
+ mScanCode = from.mScanCode;
+ mMetaState = from.mMetaState;
+ mRepeatCount = from.mRepeatCount;
+ mDownTime = from.mDownTime;
+ mEventTime = from.mEventTime;
+}
+
// class MotionEvent
void MotionEvent::initialize(