summaryrefslogtreecommitdiffstats
path: root/libs/input
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2014-02-11 14:28:48 -0800
committerJeff Brown <jeffbrown@google.com>2014-02-11 14:51:24 -0800
commitf086ddbb97e59bd4a0c27745f6e6cc9832a2d4f8 (patch)
treed8194be1e44bdaead6cc6751191f8d09379163d4 /libs/input
parent297097957f5023b73b2c5c369d0c02cbebd20fa5 (diff)
downloadframeworks_native-f086ddbb97e59bd4a0c27745f6e6cc9832a2d4f8.zip
frameworks_native-f086ddbb97e59bd4a0c27745f6e6cc9832a2d4f8.tar.gz
frameworks_native-f086ddbb97e59bd4a0c27745f6e6cc9832a2d4f8.tar.bz2
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
Diffstat (limited to 'libs/input')
-rw-r--r--libs/input/Input.cpp5
1 files changed, 5 insertions, 0 deletions
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 @@ void PointerCoords::scale(float scaleFactor) {
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();