Skip to content

Commit 23522a0

Browse files
sloukenmupfdev
authored andcommitted
Fixed motion events with TOOL_TYPE_UNKNOWN
This happens using hand tracking on a VR headset, and should be treated like normal touch interaction.
1 parent f32fd6d commit 23522a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

android-project/app/src/main/java/org/libsdl/app/SDLSurface.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ public boolean onTouch(View v, MotionEvent event) {
276276
int buttonState = (event.getButtonState() >> 4) | (1 << (toolType == MotionEvent.TOOL_TYPE_STYLUS ? 0 : 30));
277277

278278
SDLActivity.onNativePen(pointerId, buttonState, action, x, y, p);
279-
} else if (toolType == MotionEvent.TOOL_TYPE_FINGER) {
279+
} else { // MotionEvent.TOOL_TYPE_FINGER or MotionEvent.TOOL_TYPE_UNKNOWN
280280
pointerId = event.getPointerId(i);
281281
x = getNormalizedX(event.getX(i));
282282
y = getNormalizedY(event.getY(i));

0 commit comments

Comments
 (0)