0 votes

Hi,

My Problem is that a container  AND a kinematic body inside should receive mouse events. If I set the mouse filter to pass only the container receives the event and if I set it to pass only the kinematic body receives it.

This is as the documentation describes [Events Doku][1]

My Project/Why I need it

I wanted to create some kind of subview. I like the idea of containers. Inside a subview, there should be a viewport (as Local Map) and some gui Elements which I would rather place with anchor and margin. This local map has kinematic bodies which should accept events. Also, i want to be able to zoom in the map IF the mouse is on top of this viewport. To check if the mouse is inside the easiest way is to use the "mouseentered" and "mouseexited" signals of the container.
So the container needs to get the mouse events, but then ALL events are accepted, not only the ones I want (in this case the mouse_move event is most likely which triggers the entered/exited signals)

It is possible to directly call the functions of the map and its collision bodies, but this will be nearly impossible to maintain for a larger project. 
So the best way is to proper gate specific events further as if they were unhandled. In other words do the step from "controller.inputevent(ev)" to "unhandledinput(ev)" manually, but the tree does not have the unhandledinput.


Also, I think it is really strange that ALL mouse events in a container must be filtered the same way. It seems impossible that the programmer can handle specific events and leave others unhandled (in this container-node). For me this seems like a huge problem. Has somebody else problems because of this?

  [1]: https://docs.godotengine.org/en/3.0/tutorials/inputs/inputevent.html?highlight=_unhandled_input#how-does-it-work

Godot version Godot Engine v3.2.3
in Engine by (14 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.