diff options
| author | 2011-03-24 15:38:04 -0700 | |
|---|---|---|
| committer | 2011-03-24 15:38:04 -0700 | |
| commit | b7c25ce3aef3c6e930fc3f31436f52aed8ebed14 (patch) | |
| tree | 6889c2804c91f71278901d149a344870cca6826e /services/input/InputReader.cpp | |
| parent | a5d42c857818036375fff2da9f0d0ab34219d773 (diff) | |
| parent | a032cc008618b83ecbbede537517d1e7998e3264 (diff) | |
Merge "Add MotionEvent.HOVER_ENTER and HOVER_EXIT."
Diffstat (limited to 'services/input/InputReader.cpp')
| -rw-r--r-- | services/input/InputReader.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/services/input/InputReader.cpp b/services/input/InputReader.cpp index 94753bfaf419..82cf62f6f237 100644 --- a/services/input/InputReader.cpp +++ b/services/input/InputReader.cpp @@ -1605,8 +1605,15 @@ void CursorInputMapper::sync(nsecs_t when) { motionEventAction, 0, metaState, motionEventEdgeFlags, 1, &pointerId, &pointerCoords, mXPrecision, mYPrecision, downTime); - mAccumulator.clear(); + // Send hover move after UP to tell the application that the mouse is hovering now. + if (motionEventAction == AMOTION_EVENT_ACTION_UP + && mPointerController != NULL) { + getDispatcher()->notifyMotion(when, getDeviceId(), mSource, policyFlags, + AMOTION_EVENT_ACTION_HOVER_MOVE, 0, metaState, AMOTION_EVENT_EDGE_FLAG_NONE, + 1, &pointerId, &pointerCoords, mXPrecision, mYPrecision, downTime); + } + // Send scroll events. if (vscroll != 0 || hscroll != 0) { pointerCoords.setAxisValue(AMOTION_EVENT_AXIS_VSCROLL, vscroll); pointerCoords.setAxisValue(AMOTION_EVENT_AXIS_HSCROLL, hscroll); @@ -1615,6 +1622,8 @@ void CursorInputMapper::sync(nsecs_t when) { AMOTION_EVENT_ACTION_SCROLL, 0, metaState, AMOTION_EVENT_EDGE_FLAG_NONE, 1, &pointerId, &pointerCoords, mXPrecision, mYPrecision, downTime); } + + mAccumulator.clear(); } int32_t CursorInputMapper::getScanCodeState(uint32_t sourceMask, int32_t scanCode) { |