I wonder if it is intentional, like delivering simultaneously to similar listeners (mouse and cursor)?
Otherwise would it be missing if( consumed ) return true; at this line?
// It's kind of a bug but when delivering to a single MouseEventControl, the
// 'consumed' state is ignored. To emulate the behavior of both of these listener
// sets being together, I'll ignore the consumed flag here also.
// Where this comes up is in the slider thumb where previously the button click
// listener and the dragger were part of the same MouseEventControl and thus the
// drag still saw the mouse button events even though the Button itself is consuming
// them first.
// In reality, we probably want some way to add the drag listener to the beginning
// of the list.
Within a single MouseEventControl you will get the event event to all of those listeners even if the first listener in that control consumes it. Sometimes this is desirable else I will have to add a bunch of listener order management stuff.
So, if we agree to that, then it is also necessary to deliver to the cursor control also because within one spatial I needed to maintain that idea because in general mouse and cursor listeners should be interchangeable from a âwho gets the eventâ perspective.
I was looking for that explanation everywhere (class comment, method commentâŚ) least âafterâ
When the button was clicked and performed its action, my other listener got the event and that made me quite puzzled. I was generating an exception like some element had not been considered (like if I skipped coding something). Now I just generate a warning.
Basically this let us process the button click in two different places, but how to know it was consumed by a MouseButtonEvent during a CursorButtonEvent, so we can properly skip it in the 2nd if we want? The Command.execute() only gives access to the Button object.
One way I thought was count the frames and store at the Button an user object saying what was the last frame when itâs action was processed.
Obs.: at the CursorButtonEvent is where I detect what button was pressed to determine what action to take (this let me implement double (or more) clicks.
Anyway, I just removed the code from CursorButtonEvent flow, and let it alone at Command.execute(). So it is working now :).