I have an Area2D that I want to be clickable. For that, I am using the input_event signal. Problem is that I don't get how to check for various input events.

I found this old question: https://godotengine.org/qa/22606/how-ive-handled-area2d-mouse-click-not-question
but it is not working in Godot 4

I tried something like:

func _on_area_2d_input_event(viewport, event, shape_idx):
	var mouse_button = InputEventMouseButton.new()
	if event == mouse_button:
		print('entry')

But that does not work. Many thanks for the help!

Hello,
What are you trying to do achieve exactly? Looking at the Godot 4 Docs your still can use a code block similar to:

func onArea2Dinputevent( viewport, event, shapeidx ):
    if (event is InputEventMouseButton && event.pressed):
        print('Clicked')

Mouse and Input Tutorial

The InputEventButton Class has a button_index property, maybe this is what you want to capture the right button being pressed?
InpuEventMouseButton Class