map leftclick using inputmap.action_add_event()

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

how do i map left click via code?
i want to do this
InputMap.action_add_event(action, leftclick)
but i dont know how to do leftclick it says it need to be an inputevent

:bust_in_silhouette: Reply From: GameSchool


If it helps, I did that:

var temp :=
temp.button_index = MOUSE_BUTTON_LEFT
InputMap.action_add_event("test", temp)