Files
scrcpy/app/src
Pawel Jasinski c7b1d0ea9a Force mouse source when --forward-all-clicks
Right click and middle click require the source device to be a mouse,
not a touchscreen. Therefore, the source device was changed only when a
button other than the primary button was pressed (see
adc547fa6e).

However, this led to inconsistencies between the ACTION_DOWN when a
secondary button is pressed (with a mouse as source device) and the
matching ACTION_UP when the secondary button is released (with a
touchscreen as source device, because then there is no button pressed).

To avoid the problem in all cases, force a mouse as source device when
--forward-all-clicks is set.

Concretely, for mouse events in --forward-all-clicks mode:
 - device source is set to InputDevice.SOURCE_MOUSE;
 - motion event toolType is set to MotionEvent.TOOL_TYPE_MOUSE;

Otherwise (when --forward-all-clicks is unset, or for real touch
events), finger events are injected:
 - device source is set to InputDevice.SOURCE_TOUCHSCREEN;
 - motion event toolType is set to MotionEvent.TOOL_TYPE_FINGER.

Fixes #3568 <https://github.com/Genymobile/scrcpy/issues/3568>
PR #3579 <https://github.com/Genymobile/scrcpy/pull/3579>

Co-authored-by: Romain Vimont <rom@rom1v.com>
Signed-off-by: Romain Vimont <rom@rom1v.com>
2022-12-22 11:26:26 +01:00
..
2021-04-18 14:36:31 +02:00
2022-09-25 15:42:33 +02:00
2022-07-19 12:17:02 +02:00
2022-04-28 19:12:52 +02:00
2021-10-27 18:43:47 +02:00
2022-08-03 23:25:09 +02:00
2021-10-29 12:21:34 +02:00
2022-02-09 09:52:15 +01:00
2022-02-02 21:03:55 +01:00
2022-02-02 21:03:55 +01:00
2022-08-28 15:23:08 +02:00
2022-02-02 21:03:55 +01:00
2022-08-28 15:23:08 +02:00
2022-01-27 23:36:23 +01:00
2022-02-09 09:52:15 +01:00
2022-02-04 08:39:10 +01:00
2022-02-18 18:16:12 +01:00
2022-01-27 19:02:07 +01:00
2022-01-16 17:37:28 +01:00
2022-04-12 23:59:01 +02:00
2022-10-23 23:45:00 +02:00
2022-01-14 22:17:30 +01:00
2022-03-30 12:01:01 +02:00
2022-04-28 19:12:52 +02:00
2022-04-28 19:12:52 +02:00
2022-02-09 09:52:15 +01:00
2022-02-09 09:52:15 +01:00
2022-02-02 21:03:55 +01:00
2022-04-28 19:12:52 +02:00
2022-04-28 19:12:52 +02:00
2022-02-09 09:52:15 +01:00
2022-01-16 17:37:28 +01:00
2022-02-09 10:15:19 +01:00
2021-12-09 21:32:11 +01:00
2021-07-14 14:54:22 +02:00