You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tutorials/inputs/inputevent.rst
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,35 +74,35 @@ received input, in order:
74
74
2. Next if an embedded Window is focused, the event is sent to that Window and processed in
75
75
the Windows Viewport and afterwards treated as handled. If no embedded Window is focused,
76
76
the event is sent to the nodes of the current viewport in the following order.
77
-
3. First of all, the standard :ref:`Node._input() <class_Node_method__input>` function
77
+
3. First of all, the standard :ref:`Node._input() <class_Node_private_method__input>` function
78
78
will be called in any node that overrides it (and hasn't disabled input processing with :ref:`Node.set_process_input() <class_Node_method_set_process_input>`).
79
79
If any function consumes the event, it can call :ref:`Viewport.set_input_as_handled() <class_Viewport_method_set_input_as_handled>`, and the event will
80
80
not spread any more. This ensures that you can filter all events of interest, even before the GUI.
81
-
For gameplay input, :ref:`Node._unhandled_input() <class_Node_method__unhandled_input>` is generally a better fit, because it allows the GUI to intercept the events.
81
+
For gameplay input, :ref:`Node._unhandled_input() <class_Node_private_method__unhandled_input>` is generally a better fit, because it allows the GUI to intercept the events.
82
82
4. Second, it will try to feed the input to the GUI, and see if any
83
83
control can receive it. If so, the :ref:`Control <class_Control>` will be called via the
84
-
virtual function :ref:`Control._gui_input() <class_Control_method__gui_input>` and the signal
84
+
virtual function :ref:`Control._gui_input() <class_Control_private_method__gui_input>` and the signal
85
85
"gui_input" will be emitted (this function is re-implementable by
86
86
script by inheriting from it). If the control wants to "consume" the
87
87
event, it will call :ref:`Control.accept_event() <class_Control_method_accept_event>` and the event will
88
88
not spread any more. Use the :ref:`Control.mouse_filter <class_Control_property_mouse_filter>`
89
89
property to control whether a :ref:`Control <class_Control>` is notified
90
-
of mouse events via :ref:`Control._gui_input() <class_Control_method__gui_input>`
90
+
of mouse events via :ref:`Control._gui_input() <class_Control_private_method__gui_input>`
91
91
callback, and whether these events are propagated further.
92
-
5. If so far no one consumed the event, the :ref:`Node._shortcut_input() <class_Node_method__shortcut_input>` callback
92
+
5. If so far no one consumed the event, the :ref:`Node._shortcut_input() <class_Node_private_method__shortcut_input>` callback
93
93
will be called if overridden (and not disabled with
If any function consumes the event, it can call :ref:`Viewport.set_input_as_handled() <class_Viewport_method_set_input_as_handled>`, and the
@@ -112,10 +112,10 @@ received input, in order:
112
112
enabled in :ref:`Project Settings <class_ProjectSettings_property_physics/common/enable_object_picking>`.
113
113
In the case of a 3D scene if a :ref:`Camera3D <class_Camera3D>` is assigned to the Viewport, a ray
114
114
to the physics world (in the ray direction from the click) will be cast. If this ray hits an object,
115
-
it will call the :ref:`CollisionObject3D._input_event() <class_CollisionObject3D_method__input_event>`
115
+
it will call the :ref:`CollisionObject3D._input_event() <class_CollisionObject3D_private_method__input_event>`
116
116
function in the relevant physics object (bodies receive this callback by default, but areas do
117
117
not. This can be configured through :ref:`Area3D <class_Area3D>` properties).
118
-
In the case of a 2D scene, conceptually the same happens with :ref:`CollisionObject2D._input_event() <class_CollisionObject2D_method__input_event>`.
118
+
In the case of a 2D scene, conceptually the same happens with :ref:`CollisionObject2D._input_event() <class_CollisionObject2D_private_method__input_event>`.
119
119
120
120
When sending events to its child and descendant nodes, the viewport will do so, as depicted in
121
121
the following graphic, in a reverse depth-first order, starting with the node at the bottom of
@@ -124,15 +124,15 @@ and SubViewports.
124
124
125
125
.. image:: img/input_event_scene_flow.png
126
126
127
-
This order doesn't apply to :ref:`Control._gui_input() <class_Control_method__gui_input>`, which uses
127
+
This order doesn't apply to :ref:`Control._gui_input() <class_Control_private_method__gui_input>`, which uses
128
128
a different method based on event location or focused Control.
129
129
130
130
Since Viewports don't send events to other :ref:`SubViewports <class_SubViewport>`, one of the following
131
131
methods has to be used:
132
132
133
133
1. Use a :ref:`SubViewportContainer <class_SubViewportContainer>`, which automatically
134
134
sends events to its child :ref:`SubViewports <class_SubViewport>` after
135
-
:ref:`Node._input() <class_Node_method__input>` or :ref:`Control._gui_input() <class_Control_method__gui_input>`.
135
+
:ref:`Node._input() <class_Node_private_method__input>` or :ref:`Control._gui_input() <class_Control_private_method__gui_input>`.
136
136
2. Implement event propagation based on the individual requirements.
137
137
138
138
GUI events also travel up the scene tree but, since these events target
0 commit comments