summaryrefslogtreecommitdiffstats
path: root/doc/classes
diff options
context:
space:
mode:
authorkit <kitbdev@gmail.com>2023-10-31 13:55:34 -0400
committerkit <kitbdev@gmail.com>2023-11-09 09:11:59 -0500
commitd24d73ba3140b540a017bb230e57d9cde0c3d806 (patch)
tree5bf2b7f8fcb9ea5b6df7ab8f8641987920ad93ef /doc/classes
parent4c96e9676b66d0cc9a25022b019b78f4c20ddc60 (diff)
downloadredot-engine-d24d73ba3140b540a017bb230e57d9cde0c3d806.tar.gz
Make mouse-enter/exit notifications match mouse event propagation
`NOTIFICATION_MOUSE_ENTER` and `NOTIFICATION_MOUSE_EXIT` now includes the areas of children control nodes if the mouse filters allow it. In order to check if a Control node itself was entered/exited, the newly introduced `NOTIFICATION_MOUSE_ENTER_SELF` and `NOTIFICATION_MOUSE_EXIT_SELF` can be used. Co-authored-by: Markus Sauermann <6299227+Sauermann@users.noreply.github.com>
Diffstat (limited to 'doc/classes')
-rw-r--r--doc/classes/Control.xml23
1 files changed, 18 insertions, 5 deletions
diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml
index b5333a045b..a498bbeed3 100644
--- a/doc/classes/Control.xml
+++ b/doc/classes/Control.xml
@@ -1104,13 +1104,13 @@
</signal>
<signal name="mouse_entered">
<description>
- Emitted when the mouse cursor enters the control's visible area, that is not occluded behind other Controls or Windows, provided its [member mouse_filter] lets the event reach it and regardless if it's currently focused or not.
+ Emitted when the mouse cursor enters the control's (or any child control's) visible area, that is not occluded behind other Controls or Windows, provided its [member mouse_filter] lets the event reach it and regardless if it's currently focused or not.
[b]Note:[/b] [member CanvasItem.z_index] doesn't affect, which Control receives the signal.
</description>
</signal>
<signal name="mouse_exited">
<description>
- Emitted when the mouse cursor leaves the control's visible area, that is not occluded behind other Controls or Windows, provided its [member mouse_filter] lets the event reach it and regardless if it's currently focused or not.
+ Emitted when the mouse cursor leaves the control's (and all child control's) visible area, that is not occluded behind other Controls or Windows, provided its [member mouse_filter] lets the event reach it and regardless if it's currently focused or not.
[b]Note:[/b] [member CanvasItem.z_index] doesn't affect, which Control receives the signal.
[b]Note:[/b] If you want to check whether the mouse truly left the area, ignoring any top nodes, you can use code like this:
[codeblock]
@@ -1150,12 +1150,24 @@
Sent when the node changes size. Use [member size] to get the new size.
</constant>
<constant name="NOTIFICATION_MOUSE_ENTER" value="41">
- Sent when the mouse cursor enters the control's visible area, that is not occluded behind other Controls or Windows, provided its [member mouse_filter] lets the event reach it and regardless if it's currently focused or not.
- [b]Note:[/b] [member CanvasItem.z_index] doesn't affect, which Control receives the notification.
+ Sent when the mouse cursor enters the control's (or any child control's) visible area, that is not occluded behind other Controls or Windows, provided its [member mouse_filter] lets the event reach it and regardless if it's currently focused or not.
+ [b]Note:[/b] [member CanvasItem.z_index] doesn't affect which Control receives the notification.
+ See also [constant NOTIFICATION_MOUSE_ENTER_SELF].
</constant>
<constant name="NOTIFICATION_MOUSE_EXIT" value="42">
+ Sent when the mouse cursor leaves the control's (and all child control's) visible area, that is not occluded behind other Controls or Windows, provided its [member mouse_filter] lets the event reach it and regardless if it's currently focused or not.
+ [b]Note:[/b] [member CanvasItem.z_index] doesn't affect which Control receives the notification.
+ See also [constant NOTIFICATION_MOUSE_EXIT_SELF].
+ </constant>
+ <constant name="NOTIFICATION_MOUSE_ENTER_SELF" value="60" is_experimental="true">
+ Sent when the mouse cursor enters the control's visible area, that is not occluded behind other Controls or Windows, provided its [member mouse_filter] lets the event reach it and regardless if it's currently focused or not.
+ [b]Note:[/b] [member CanvasItem.z_index] doesn't affect which Control receives the notification.
+ See also [constant NOTIFICATION_MOUSE_ENTER].
+ </constant>
+ <constant name="NOTIFICATION_MOUSE_EXIT_SELF" value="61" is_experimental="true">
Sent when the mouse cursor leaves the control's visible area, that is not occluded behind other Controls or Windows, provided its [member mouse_filter] lets the event reach it and regardless if it's currently focused or not.
- [b]Note:[/b] [member CanvasItem.z_index] doesn't affect, which Control receives the notification.
+ [b]Note:[/b] [member CanvasItem.z_index] doesn't affect which Control receives the notification.
+ See also [constant NOTIFICATION_MOUSE_EXIT].
</constant>
<constant name="NOTIFICATION_FOCUS_ENTER" value="43">
Sent when the node grabs focus.
@@ -1320,6 +1332,7 @@
</constant>
<constant name="MOUSE_FILTER_IGNORE" value="2" enum="MouseFilter">
The control will not receive mouse movement input events and mouse button input events if clicked on 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.
+ [b]Note:[/b] If the control has received [signal mouse_entered] but not [signal mouse_exited], changing the [member mouse_filter] to [constant MOUSE_FILTER_IGNORE] will cause [signal mouse_exited] to be emitted.
</constant>
<constant name="GROW_DIRECTION_BEGIN" value="0" enum="GrowDirection">
The control will grow to the left or top to make up if its minimum size is changed to be greater than its current size on the respective axis.