Add support for injecting events into ActivityContainers.
Enhanced the input system to support concurrent dispatch of touch
events on multiple displays which is required for this to work.
Add method to apply offset to PointerCoords.
Change-Id: I55fe4a9a8785ae5a2d3341d214fa3c5107f3963a
diff --git a/libs/input/Input.cpp b/libs/input/Input.cpp
index 6f53996..ccbf52b 100644
--- a/libs/input/Input.cpp
+++ b/libs/input/Input.cpp
@@ -213,6 +213,11 @@
scaleAxisValue(*this, AMOTION_EVENT_AXIS_TOOL_MINOR, scaleFactor);
}
+void PointerCoords::applyOffset(float xOffset, float yOffset) {
+ setAxisValue(AMOTION_EVENT_AXIS_X, getX() + xOffset);
+ setAxisValue(AMOTION_EVENT_AXIS_Y, getY() + yOffset);
+}
+
#ifdef HAVE_ANDROID_OS
status_t PointerCoords::readFromParcel(Parcel* parcel) {
bits = parcel->readInt64();