How can i listen for mouse up event

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By mob_ai
:warning: Old Version Published before Godot 3 was released.
func _input(event):
    if event.type == InputEvent.MOUSE_BUTTON && event.pressed:
        print("pressed")

I know i can use is_action_released("action_name") but i want to know is there any another way to do the same?

THANKS GUYS :slight_smile:

:bust_in_silhouette: Reply From: mollusca

It’s quite simple:

func _input(event):
    if event.type == InputEvent.MOUSE_BUTTON and !event.pressed:
        print("released")

Wonderful, what a dumb ass i’m.!!
Anyway thank you very much :slight_smile:

mob_ai | 2017-06-08 12:14

doesn’t wotk for me

event.type == InputEvent.MOUSE_BUTTON

another variant

event is InputEventMouseButton

better to check wich button pressed

and event.button_index == BUTTON_LEFT

xo6a | 2021-03-14 20:10