mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 10:11:57 +03:00
Make SubViewportContainer event propagation aware of focused Control
Propagate `InputEvents` without position either - during the Input-stage, when it has focus or - during the Unhandled-Input-stage, otherwise This makes sure that Gui-Input happens in the correct order. Move "Unhandled key Input" handling before "Unhandled Input" handling, so that Unicode input with Alt / Ctrl modifiers are sent to the nodes in the correct order. Change the default focus mode of `SubViewportContainer` from `FOCUS_NONE` to `FOCUS_CLICK`, to automatically remove focus from other `Control`-nodes, when clicking inside a `SubViewport`.
This commit is contained in:
@@ -41,6 +41,7 @@ class SubViewportContainer : public Container {
|
||||
void _notify_viewports(int p_notification);
|
||||
bool _is_propagated_in_gui_input(const Ref<InputEvent> &p_event);
|
||||
void _send_event_to_viewports(const Ref<InputEvent> &p_event);
|
||||
void _propagate_nonpositional_event(const Ref<InputEvent> &p_event);
|
||||
|
||||
protected:
|
||||
void _notification(int p_what);
|
||||
@@ -54,6 +55,7 @@ public:
|
||||
bool is_stretch_enabled() const;
|
||||
|
||||
virtual void input(const Ref<InputEvent> &p_event) override;
|
||||
virtual void unhandled_input(const Ref<InputEvent> &p_event) override;
|
||||
virtual void gui_input(const Ref<InputEvent> &p_event) override;
|
||||
void set_stretch_shrink(int p_shrink);
|
||||
int get_stretch_shrink() const;
|
||||
|
||||
Reference in New Issue
Block a user