mirror of
https://github.com/godotengine/godot
synced 2024-09-05 17:41:41 +00:00
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.
This commit is contained in:
parent
97df6de4a7
commit
408000752c
|
@ -422,7 +422,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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue