diff options
author | 2010-06-17 20:52:56 -0700 | |
---|---|---|
committer | 2010-06-21 13:59:34 -0700 | |
commit | 7fbdc84e87dd3a0e196b9803bb04495d11e9cb8a (patch) | |
tree | 32691f639ef71365b602795db215f11f457397a5 /libs/ui/InputReader.cpp | |
parent | e47e3f3855a062ba0338a57eeda2f12a0f7a1fa8 (diff) |
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 5a280aed37a7..1824054e0b57 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; |