mouse click event processing

Godot Version

4.3

Question

I want mouse click to result in a single click. Press and release of a button should produce only one event.

Right now it’s not possible out of the box. At least it’s my diagnosis. I saw some threads, but havn’t found a solution.

I have a set of controls for a card, clicking a card result in multiple cards played. As I understand when button is pressed, an event is triggered with pressed true. This event is processed by card under cursor, card is removed and another card moves under cursor and also gets an event.

May be I misunderstanding something.

Any help?

Are you processing the event in _input() or _unhandled_input() method on multiple instances of your cards? Then the event will be multiplied by the amount of instances you have. Make sure you only handle it once, e.g. by handling your input only in _unhandled_input() method and setting it as handled with Viewport.set_inpu_as_handled() method:

This ensures your input is handled only once.