Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 611712ae authored by Nathaniel R. Lewis's avatar Nathaniel R. Lewis Committed by Linzhao Ye
Browse files

Add relative field to captured cursor device

Mice by their nature are relative devices, there is no concept of an
absolute position of the physical device. Pointer capture is designed
to provide apps the ability to get the raw motion of the mouse,
however, the relative motion of the mouse is provided in the AXIS_X/Y
fields, which are canonically used for absolute positions of touches
or cursors on the display.

This patch copies these relative values into the AXIS_RELATIVE_X/Y
fields so that apps that want exclusive relative information from a
captured input device can use the same field for both mice and
touchpads.

Test: connect a mouse to an android device and capture the pointer
      within an app. MotionEvents from onCapturedPointerEvent() should
      contain AXIS_RELATIVE_X/Y fields identical to the AXIS_X/Y
      field.

Bug: 38511270
Change-Id: Ib1dffb68411a5c632658715ab940bcf07d5181b8
Merged-In: Ib1dffb68411a5c632658715ab940bcf07d5181b8
parent 50908afd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment