From 5b98c4a524317a4385b6e094e4eef13657232ad4 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 14 Feb 2025 11:50:43 -0800 Subject: [PATCH] Fixed motion events with TOOL_TYPE_UNKNOWN This happens using hand tracking on a VR headset, and should be treated like normal touch interaction. --- .../app/src/main/java/org/libsdl/app/SDLSurface.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android-project/app/src/main/java/org/libsdl/app/SDLSurface.java b/android-project/app/src/main/java/org/libsdl/app/SDLSurface.java index 1658821340..080501c9fa 100644 --- a/android-project/app/src/main/java/org/libsdl/app/SDLSurface.java +++ b/android-project/app/src/main/java/org/libsdl/app/SDLSurface.java @@ -276,7 +276,7 @@ public class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, int buttonState = (event.getButtonState() >> 4) | (1 << (toolType == MotionEvent.TOOL_TYPE_STYLUS ? 0 : 30)); SDLActivity.onNativePen(pointerId, buttonState, action, x, y, p); - } else if (toolType == MotionEvent.TOOL_TYPE_FINGER) { + } else { // MotionEvent.TOOL_TYPE_FINGER or MotionEvent.TOOL_TYPE_UNKNOWN pointerId = event.getPointerId(i); x = getNormalizedX(event.getX(i)); y = getNormalizedY(event.getY(i));