Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Mouse Filter Pass to pass through controls in the order in which they are placed #7167

Open
darthLeviN opened this issue Jun 27, 2023 · 2 comments

Comments

@darthLeviN
Copy link

darthLeviN commented Jun 27, 2023

Describe the project you are working on

The concept of mouse pass is to let the controls behind a control also receive mouse events. however this is not possible.

Describe the problem or limitation you are having in your project

I want mouse events to pass through controls in the order which they are placed. I feel like the current mouse pass mechanism wasn't developed because it was supposed to work this way, but rather developed this way because it was easy to code it this way without any additional effort.

It's easy to check for the mouse filter of the parent and pass the event. it's not easy to look for a control behind. and that's why it is working this way.

The tree structure is meant to help, not restrict gui design.

While i understand that this might introduce some incompatibilities with the current games and applications, It's how it's meant to be. to resolve the incompatibility issue we can name it something new like Mouse Pass Visual

My justification is that many users end up thinking mouse pass is meant to pass the events to the controls behind when they realize it only passes to parent afterwards.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

program a mouse pass mechanism.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Control A owns control B and C.

C is in front of B.

1- C receives a mouse event.
2- B receives a mouse event.
3- A receives a mouse event.

If this enhancement will not be used often, can it be worked around with a few lines of script?

No

Is there a reason why this should be core and not an add-on in the asset library?

It can't be in a asset library.

@Calinou
Copy link
Member

Calinou commented Jun 27, 2023

@Calinou Calinou changed the title Mouse pass isn't what it should be. Change Mouse Filter Pass to pass through controls in the order in which they are placed Jun 27, 2023
@kitbdev
Copy link

kitbdev commented Nov 13, 2023

Godot uses Event Bubbling intentionally, not because it was easier to implement.

I think the confusion comes from the name MOUSE_FILTER_PASS, which can be misinterpreted.
We should change the name to be more clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants