2
0
Эх сурвалжийг харах

handle ambiguous input events as touch events

there can be events can have both SOURCE_TOUCHSCREEN and SOURCE_STYLUS. handle them as touch events rather than mouse events.

(cherry picked from commit 408000752cb39f93b2639fdeefb783e4dd76910f)
Dennis Ranke 2 жил өмнө
parent
commit
55441f2301

+ 1 - 1
platform/android/java/lib/src/org/godotengine/godot/input/GodotInputHandler.java

@@ -423,7 +423,7 @@ public class GodotInputHandler implements InputManager.InputDeviceListener {
 	}
 
 	private static boolean isMouseEvent(int eventSource) {
-		boolean mouseSource = ((eventSource & InputDevice.SOURCE_MOUSE) == InputDevice.SOURCE_MOUSE) || ((eventSource & InputDevice.SOURCE_STYLUS) == InputDevice.SOURCE_STYLUS);
+		boolean mouseSource = ((eventSource & InputDevice.SOURCE_MOUSE) == InputDevice.SOURCE_MOUSE) || ((eventSource & (InputDevice.SOURCE_TOUCHSCREEN | InputDevice.SOURCE_STYLUS)) == InputDevice.SOURCE_STYLUS);
 		if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
 			mouseSource = mouseSource || ((eventSource & InputDevice.SOURCE_MOUSE_RELATIVE) == InputDevice.SOURCE_MOUSE_RELATIVE);
 		}