mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-02-16 02:20:55 +00:00
Ignore relative mouse inputs from non-mouse tools
Apparently this can happen for the SPen on Android 12
This commit is contained in:
@@ -96,7 +96,7 @@ public class AndroidNativePointerCaptureProvider extends AndroidPointerIconCaptu
|
||||
// SOURCE_TOUCHPAD will have relative axes populated iff our view has pointer capture.
|
||||
// See https://developer.android.com/reference/android/view/View#requestPointerCapture()
|
||||
int eventSource = event.getSource();
|
||||
return eventSource == InputDevice.SOURCE_MOUSE_RELATIVE ||
|
||||
return (eventSource == InputDevice.SOURCE_MOUSE_RELATIVE && event.getToolType(0) == MotionEvent.TOOL_TYPE_MOUSE) ||
|
||||
(eventSource == InputDevice.SOURCE_TOUCHPAD && targetView.hasPointerCapture());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user