Merge "Implement native key pre-dispatching to IMEs." into gingerbread
diff --git a/include/ui/Input.h b/include/ui/Input.h
index f069888..d9b1091 100644
--- a/include/ui/Input.h
+++ b/include/ui/Input.h
@@ -152,6 +152,7 @@
protected:
void initialize(int32_t deviceId, int32_t source);
+ void initialize(const InputEvent& from);
private:
int32_t mDeviceId;
@@ -202,6 +203,7 @@
int32_t repeatCount,
nsecs_t downTime,
nsecs_t eventTime);
+ void initialize(const KeyEvent& from);
private:
int32_t mAction;
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 @@
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 @@
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(