Area2D doesn't detect InputEventScreenDrag?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By RudyFisher

My goal is to support universal input for a cross-platform game. Here is the basics of my input event handler for my touchscreen joystick:

func _on_area_input_event(_viewport: Node, event: InputEvent, _shape_idx: int) -> void:
if event is InputEventScreenDrag:
	var drag: InputEventScreenDrag = event as InputEventScreenDrag
	_pressed = true
elif event is InputEventMouseMotion:
	var motion: InputEventMouseMotion = event as InputEventMouseMotion
	_pressed = motion.pressure > 0.0
elif event is InputEventScreenTouch:
	var touch := event as InputEventScreenTouch
	_pressed = touch.pressed
elif event is InputEventMouseButton:
	var touch := event as InputEventMouseButton
	_pressed = touch.pressed

In project settings > pointing, I have both emulate mouse from touch and emulate touch from mouse enabled. Mouse motion works great, but InputEventScreenDrag doesn’t seem to be recognized by my Area2D once exported onto my Android device (Samsung). Any help appreciated.


:bust_in_silhouette: Reply From: RudyFisher

(Of course, once I ask the question, I stumble onto the solution ha…)

The issue was this line:

_pressed = motion.pressure > 0.0

I found it works if this line is deleted. It’s not needed with emulation on.

Have a great day you wonderful people.