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 <https://github.com/Genymobile/scrcpy/issues/1362>
@@ -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);
}
