mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-31 14:18:40 +08:00
Fixed motion events with TOOL_TYPE_UNKNOWN
This happens using hand tracking on a VR headset, and should be treated like normal touch interaction.
This commit is contained in:
@@ -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));
|
int buttonState = (event.getButtonState() >> 4) | (1 << (toolType == MotionEvent.TOOL_TYPE_STYLUS ? 0 : 30));
|
||||||
|
|
||||||
SDLActivity.onNativePen(pointerId, buttonState, action, x, y, p);
|
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);
|
pointerId = event.getPointerId(i);
|
||||||
x = getNormalizedX(event.getX(i));
|
x = getNormalizedX(event.getX(i));
|
||||||
y = getNormalizedY(event.getY(i));
|
y = getNormalizedY(event.getY(i));
|
||||||
|
|||||||
Reference in New Issue
Block a user