func _click():
var a = InputEventMouseButton.new()
a.set_button_index(1)
a.set_pressed(true)
Input.parse_input_event(a)
Adam_S | 2019-01-21 16:41
The error message looks more like the debugger lost the connection to your app. This mostly happened when the app/program fails. (Without a proper error message.)
Maybe it is problematic calling “parse _ input _ event” just at that moment. (I.e. when handling another event)
You could try call_deferred:
func _click():
call_deferred("do_a_left_click")
func do_a_left_click:
var a = InputEventMouseButton.new()
a.set_button_index(1)
a.set_pressed(true)
Input.parse_input_event(a)