diff options
author | Jeff Brown <jeffbrown@google.com> | 2010-06-17 20:52:56 -0700 |
---|---|---|
committer | Jeff Brown <jeffbrown@google.com> | 2010-06-21 13:59:34 -0700 |
commit | 51d45a710eff6da1749ae66ce9cab218144c388b (patch) | |
tree | 24f822116a86d5bf98734acffb5fe195507a7b60 /libs/ui/InputReader.cpp | |
parent | a2f89660b4d427c34884109cf70655f20d84d2ad (diff) | |
download | frameworks_native-51d45a710eff6da1749ae66ce9cab218144c388b.zip frameworks_native-51d45a710eff6da1749ae66ce9cab218144c388b.tar.gz frameworks_native-51d45a710eff6da1749ae66ce9cab218144c388b.tar.bz2 |
More native input event dispatching.
Added ANRs handling.
Added event injection.
Fixed a NPE ActivityManagerServer writing ANRs to the drop box.
Fixed HOME key interception.
Fixed trackball reporting.
Fixed pointer rotation in landscape mode.
Change-Id: I50340f559f22899ab924e220a78119ffc79469b7
Diffstat (limited to 'libs/ui/InputReader.cpp')
-rw-r--r-- | libs/ui/InputReader.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libs/ui/InputReader.cpp b/libs/ui/InputReader.cpp index 5a280ae..1824054 100644 --- a/libs/ui/InputReader.cpp +++ b/libs/ui/InputReader.cpp @@ -1444,7 +1444,7 @@ void InputReader::dispatchTouch(nsecs_t when, InputDevice* device, uint32_t poli case InputReaderPolicyInterface::ROTATION_90: { float xTemp = x; x = y; - y = mDisplayHeight - xTemp; + y = mDisplayWidth - xTemp; break; } case InputReaderPolicyInterface::ROTATION_180: { @@ -1454,7 +1454,7 @@ void InputReader::dispatchTouch(nsecs_t when, InputDevice* device, uint32_t poli } case InputReaderPolicyInterface::ROTATION_270: { float xTemp = x; - x = mDisplayWidth - y; + x = mDisplayHeight - y; y = xTemp; break; } @@ -1510,7 +1510,7 @@ void InputReader::onTrackballStateChanged(nsecs_t when, uint32_t fields = device->trackball.accumulator.fields; bool downChanged = fields & InputDevice::TrackballState::Accumulator::FIELD_BTN_MOUSE; - bool deltaChanged = (fields & DELTA_FIELDS) == DELTA_FIELDS; + bool deltaChanged = fields & DELTA_FIELDS; bool down; if (downChanged) { @@ -1546,10 +1546,10 @@ void InputReader::onTrackballStateChanged(nsecs_t when, int32_t pointerId = 0; PointerCoords pointerCoords; - pointerCoords.x = device->trackball.accumulator.relX - * device->trackball.precalculated.xScale; - pointerCoords.y = device->trackball.accumulator.relY - * device->trackball.precalculated.yScale; + pointerCoords.x = fields & InputDevice::TrackballState::Accumulator::FIELD_REL_X + ? device->trackball.accumulator.relX * device->trackball.precalculated.xScale : 0; + pointerCoords.y = fields & InputDevice::TrackballState::Accumulator::FIELD_REL_Y + ? device->trackball.accumulator.relY * device->trackball.precalculated.yScale : 0; pointerCoords.pressure = 1.0f; // XXX Consider making this 1.0f if down, 0 otherwise. pointerCoords.size = 0; |