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

Overridden input function not receiving mouse inputs when parent subviewport is unfocused #73436

Closed
MACMAN2003 opened this issue Feb 16, 2023 · 2 comments
Labels

Comments

@MACMAN2003
Copy link

Godot version

v4.0.rc1.mono.official [8843d9a]

System information

Windows 10, Vulkan, Nvidia RTX 2080 TI

Issue description

When I override input on a node that is a child of a subviewport that is "unfocused", it doesn't receive mouse inputs, yet still receives keyboard inputs and actions.
A few updates ago it was working as intended and I don't know what happened to make it stop working.

Steps to reproduce

  • Make new project
  • make a scene with a tabcontainer and two subviewports as its children
  • give one of the subviewports a sprite2d and override its _input to make it green when there's mouse input and red when there's keyboard input
  • notice that mouse input is not received by the sprite2d when its parent subviewport is unfocused

minimal reproduction project instructions

  • middle mouse to drag the camera
  • left click to randomly teleport the camera
  • WASD to move the camera
  • notice that the camera doesn't receive mouse input when its parent subviewport is unfocused

Minimal reproduction project

subviewportinput.zip

@Sauermann
Copy link
Contributor

This was intentionally changed in #58334 in order to fix #28833 and #39666. (Basically unrestricted mouse events in SubViewports led to multiple issues)

If you need these events in unfocused SubViewports, you need to override _input or _unhandled_input of the respective SubViewportContainer and handle event-propagation for mouse events to the SubViewport yourself.
Let me know, if you need an example of how to implement this.

@MACMAN2003
Copy link
Author

oh,
well i guess the only thing i can do now is workaround it and cross my fingers that the godot devs will add a setting for subviewportcontainers to allow propagation

@MACMAN2003 MACMAN2003 closed this as not planned Won't fix, can't repro, duplicate, stale Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants