Send scroll events as a touchscreen

Scroll events were sent with a mouse input device. When scrolling on a
list, this could cause the whole list to be focused, and drawn with the
focus color as background.

Send scroll events with a touchscreen input device instead (like motion
events).

Fixes #1362 <https://github.com/Genymobile/scrcpy/issues/1362>
This commit is contained in:
Romain Vimont 2020-05-07 15:08:11 +02:00
parent ead7ee4a03
commit e2d5f0e7fc

View file

@ -215,7 +215,7 @@ public class Controller {
MotionEvent event = MotionEvent
.obtain(lastTouchDown, now, MotionEvent.ACTION_SCROLL, 1, pointerProperties, pointerCoords, 0, 0, 1f, 1f, DEVICE_ID_VIRTUAL, 0,
InputDevice.SOURCE_MOUSE, 0);
InputDevice.SOURCE_TOUCHSCREEN, 0);
return injectEvent(event);
}