This commit is contained in:
BimDav 2021-11-11 11:20:51 +03:00 committed by GitHub
commit ab5a92077f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 12 deletions

View file

@ -1284,7 +1284,7 @@
The control will receive mouse button input events through [method _gui_input] if clicked on. And the control will receive the [signal mouse_entered] and [signal mouse_exited] signals. These events are automatically marked as handled, and they will not propagate further to other controls. This also results in blocking signals in other controls.
</constant>
<constant name="MOUSE_FILTER_PASS" value="1" enum="MouseFilter">
The control will receive mouse button input events through [method _gui_input] if clicked on. And the control will receive the [signal mouse_entered] and [signal mouse_exited] signals. If this control does not handle the event, the parent control (if any) will be considered, and so on until there is no more parent control to potentially handle it. This also allows signals to fire in other controls. Even if no control handled it at all, the event will still be handled automatically, so unhandled input will not be fired.
The control will receive mouse button input events through [method _gui_input] if clicked on. And the control will receive the [signal mouse_entered] and [signal mouse_exited] signals. If this control does not handle the event, the parent control (if any) will be considered, and so on until there is no more parent control to potentially handle it. This also allows signals to fire in other controls. If no control handled it at all, the event will continue propagating to _unhandled_input methods.
</constant>
<constant name="MOUSE_FILTER_IGNORE" value="2" enum="MouseFilter">
The control will not receive mouse button input events through [method _gui_input]. The control will also not receive the [signal mouse_entered] nor [signal mouse_exited] signals. This will not block other controls from receiving these events or firing the signals. Ignored events will not be handled automatically.

View file

@ -1280,9 +1280,11 @@ void Viewport::_gui_call_input(Control *p_control, const Ref<InputEvent> &p_inpu
break;
}
if (gui.key_event_accepted) {
set_input_as_handled();
break;
}
if (!cant_stop_me_now && control->data.mouse_filter == Control::MOUSE_FILTER_STOP && ismouse) {
set_input_as_handled();
break;
}
}
@ -1511,8 +1513,6 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
_gui_call_input(gui.mouse_focus, mb);
}
set_input_as_handled();
if (gui.drag_data.get_type() != Variant::NIL && mb->get_button_index() == MOUSE_BUTTON_LEFT) {
// Alternate drop use (when using force_drag(), as proposed by #5342).
if (gui.mouse_focus) {
@ -1603,8 +1603,6 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
}
gui.mouse_over = over;
set_input_as_handled();
}
}
@ -1778,8 +1776,6 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
if (over && over->can_process()) {
_gui_call_input(over, mm);
}
set_input_as_handled();
}
if (gui.drag_data.get_type() != Variant::NIL) {
@ -1902,7 +1898,6 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
touch_event->set_position(pos);
_gui_call_input(over, touch_event);
}
set_input_as_handled();
return;
}
} else if (touch_event->get_index() == 0 && gui.last_mouse_focus) {
@ -1912,7 +1907,6 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
_gui_call_input(gui.last_mouse_focus, touch_event);
}
set_input_as_handled();
return;
}
}
@ -1937,7 +1931,6 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
gesture_event->set_position(pos);
_gui_call_input(over, gesture_event);
}
set_input_as_handled();
return;
}
}
@ -1963,8 +1956,6 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
_gui_call_input(over, drag_event);
}
set_input_as_handled();
return;
}
}