diff options
| author | 2020-10-10 19:13:00 +0000 | |
|---|---|---|
| committer | 2020-10-10 19:13:00 +0000 | |
| commit | bd764d9ebd6708911beaf81d0b44eb49657f64ad (patch) | |
| tree | e34666f26ed532ab849d0e0d84b5a40645a591ec | |
| parent | 910dc1603b3416ce1daa0c0b8842a031a6f6d4ca (diff) | |
| parent | 611712ae14fd8d9810dff04cfb2d419ee77b9493 (diff) | |
Add relative field to captured cursor device am: 611712ae14
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1447897
Change-Id: Ic40fa72c85176cdca5720f62d515c4937111d0e0
| -rw-r--r-- | services/inputflinger/reader/mapper/CursorInputMapper.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/services/inputflinger/reader/mapper/CursorInputMapper.cpp b/services/inputflinger/reader/mapper/CursorInputMapper.cpp index 1a4d5517e2..3b7068467a 100644 --- a/services/inputflinger/reader/mapper/CursorInputMapper.cpp +++ b/services/inputflinger/reader/mapper/CursorInputMapper.cpp @@ -80,6 +80,10 @@ void CursorInputMapper::populateDeviceInfo(InputDeviceInfo* info) { } else { info->addMotionRange(AMOTION_EVENT_AXIS_X, mSource, -1.0f, 1.0f, 0.0f, mXScale, 0.0f); info->addMotionRange(AMOTION_EVENT_AXIS_Y, mSource, -1.0f, 1.0f, 0.0f, mYScale, 0.0f); + info->addMotionRange(AMOTION_EVENT_AXIS_RELATIVE_X, mSource, -1.0f, 1.0f, 0.0f, mXScale, + 0.0f); + info->addMotionRange(AMOTION_EVENT_AXIS_RELATIVE_Y, mSource, -1.0f, 1.0f, 0.0f, mYScale, + 0.0f); } info->addMotionRange(AMOTION_EVENT_AXIS_PRESSURE, mSource, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f); @@ -339,6 +343,8 @@ void CursorInputMapper::sync(nsecs_t when) { } else { pointerCoords.setAxisValue(AMOTION_EVENT_AXIS_X, deltaX); pointerCoords.setAxisValue(AMOTION_EVENT_AXIS_Y, deltaY); + pointerCoords.setAxisValue(AMOTION_EVENT_AXIS_RELATIVE_X, deltaX); + pointerCoords.setAxisValue(AMOTION_EVENT_AXIS_RELATIVE_Y, deltaY); displayId = ADISPLAY_ID_NONE; } |