Merge pull request #66855 from Jantho1990/bugfix/update-control-focus-signal-documentation-3.x
update messaging for focus to be less keyboard-specific (3.x)
This commit is contained in:
commit
d81a253f9f
1 changed files with 14 additions and 14 deletions
|
@ -7,8 +7,8 @@
|
|||
Base class for all UI-related nodes. [Control] features a bounding rectangle that defines its extents, an anchor position relative to its parent control or the current viewport, and margins that represent an offset to the anchor. The margins update automatically when the node, any of its parents, or the screen size change.
|
||||
For more information on Godot's UI system, anchors, margins, and containers, see the related tutorials in the manual. To build flexible UIs, you'll need a mix of UI elements that inherit from [Control] and [Container] nodes.
|
||||
[b]User Interface nodes and input[/b]
|
||||
Godot sends input events to the scene's root node first, by calling [method Node._input]. [method Node._input] forwards the event down the node tree to the nodes under the mouse cursor, or on keyboard focus. To do so, it calls [method MainLoop._input_event]. Call [method accept_event] so no other node receives the event. Once you accept an input, it becomes handled so [method Node._unhandled_input] will not process it.
|
||||
Only one [Control] node can be in keyboard focus. Only the node in focus will receive keyboard events. To get the focus, call [method grab_focus]. [Control] nodes lose focus when another node grabs it, or if you hide the node in focus.
|
||||
Godot sends input events to the scene's root node first, by calling [method Node._input]. [method Node._input] forwards the event down the node tree to the nodes under the mouse cursor, or in focus. To do so, it calls [method MainLoop._input_event]. Call [method accept_event] so no other node receives the event. Once you accept an input, it becomes handled so [method Node._unhandled_input] will not process it.
|
||||
Only one [Control] node can be in focus. Only the node in focus will receive events. To get the focus, call [method grab_focus]. [Control] nodes lose focus when another node grabs it, or if you hide the node in focus.
|
||||
Sets [member mouse_filter] to [constant MOUSE_FILTER_IGNORE] to tell a [Control] node to ignore mouse or touch events. You'll need it if you place an icon on top of a button.
|
||||
[Theme] resources change the Control's appearance. If you change the [Theme] on a [Control] node, it affects all of its children. To override some of the theme's parameters, call one of the [code]add_*_override[/code] methods, like [method add_font_override]. You can override the theme with the inspector.
|
||||
[b]Note:[/b] Theme items are [i]not[/i] [Object] properties. This means you can't access their values using [method Object.get] and [method Object.set]. Instead, use [method get_color], [method get_constant], [method get_font], [method get_icon], [method get_stylebox], and the [code]add_*_override[/code] methods provided by this class.
|
||||
|
@ -294,7 +294,7 @@
|
|||
<method name="get_focus_owner" qualifiers="const">
|
||||
<return type="Control" />
|
||||
<description>
|
||||
Returns the control that has the keyboard focus or [code]null[/code] if none.
|
||||
Returns the control that has focus or [code]null[/code] if none.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_font" qualifiers="const">
|
||||
|
@ -522,7 +522,7 @@
|
|||
<method name="release_focus">
|
||||
<return type="void" />
|
||||
<description>
|
||||
Give up the focus. No other control will be able to receive keyboard input.
|
||||
Give up the focus. No other control will be able to receive keyboard or gamepad input.
|
||||
</description>
|
||||
</method>
|
||||
<method name="remove_color_override">
|
||||
|
@ -758,26 +758,26 @@
|
|||
Anchors the top edge of the node to the origin, the center or the end of its parent control. It changes how the top margin updates when the node moves or changes size. You can use one of the [enum Anchor] constants for convenience.
|
||||
</member>
|
||||
<member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" enum="Control.FocusMode" default="0">
|
||||
The focus access mode for the control (None, Click or All). Only one Control can be focused at the same time, and it will receive keyboard signals.
|
||||
The focus access mode for the control (None, Click or All). Only one Control can be focused at the same time, and it will receive keyboard, gamepad, and mouse signals.
|
||||
</member>
|
||||
<member name="focus_neighbour_bottom" type="NodePath" setter="set_focus_neighbour" getter="get_focus_neighbour" default="NodePath("")">
|
||||
Tells Godot which node it should give keyboard focus to if the user presses the down arrow on the keyboard or down on a gamepad by default. You can change the key by editing the [code]ui_down[/code] input action. The node must be a [Control]. If this property is not set, Godot will give focus to the closest [Control] to the bottom of this one.
|
||||
Tells Godot which node it should give focus to if the user presses the down arrow on the keyboard or down on a gamepad by default. You can change the key by editing the [code]ui_down[/code] input action. The node must be a [Control]. If this property is not set, Godot will give focus to the closest [Control] to the bottom of this one.
|
||||
</member>
|
||||
<member name="focus_neighbour_left" type="NodePath" setter="set_focus_neighbour" getter="get_focus_neighbour" default="NodePath("")">
|
||||
Tells Godot which node it should give keyboard focus to if the user presses the left arrow on the keyboard or left on a gamepad by default. You can change the key by editing the [code]ui_left[/code] input action. The node must be a [Control]. If this property is not set, Godot will give focus to the closest [Control] to the left of this one.
|
||||
Tells Godot which node it should give focus to if the user presses the left arrow on the keyboard or left on a gamepad by default. You can change the key by editing the [code]ui_left[/code] input action. The node must be a [Control]. If this property is not set, Godot will give focus to the closest [Control] to the left of this one.
|
||||
</member>
|
||||
<member name="focus_neighbour_right" type="NodePath" setter="set_focus_neighbour" getter="get_focus_neighbour" default="NodePath("")">
|
||||
Tells Godot which node it should give keyboard focus to if the user presses the right arrow on the keyboard or right on a gamepad by default. You can change the key by editing the [code]ui_right[/code] input action. The node must be a [Control]. If this property is not set, Godot will give focus to the closest [Control] to the bottom of this one.
|
||||
Tells Godot which node it should give focus to if the user presses the right arrow on the keyboard or right on a gamepad by default. You can change the key by editing the [code]ui_right[/code] input action. The node must be a [Control]. If this property is not set, Godot will give focus to the closest [Control] to the bottom of this one.
|
||||
</member>
|
||||
<member name="focus_neighbour_top" type="NodePath" setter="set_focus_neighbour" getter="get_focus_neighbour" default="NodePath("")">
|
||||
Tells Godot which node it should give keyboard focus to if the user presses the top arrow on the keyboard or top on a gamepad by default. You can change the key by editing the [code]ui_top[/code] input action. The node must be a [Control]. If this property is not set, Godot will give focus to the closest [Control] to the bottom of this one.
|
||||
Tells Godot which node it should give focus to if the user presses the top arrow on the keyboard or top on a gamepad by default. You can change the key by editing the [code]ui_top[/code] input action. The node must be a [Control]. If this property is not set, Godot will give focus to the closest [Control] to the bottom of this one.
|
||||
</member>
|
||||
<member name="focus_next" type="NodePath" setter="set_focus_next" getter="get_focus_next" default="NodePath("")">
|
||||
Tells Godot which node it should give keyboard focus to if the user presses [kbd]Tab[/kbd] on a keyboard by default. You can change the key by editing the [code]ui_focus_next[/code] input action.
|
||||
Tells Godot which node it should give focus to if the user presses [kbd]Tab[/kbd] on a keyboard by default. You can change the key by editing the [code]ui_focus_next[/code] input action.
|
||||
If this property is not set, Godot will select a "best guess" based on surrounding nodes in the scene tree.
|
||||
</member>
|
||||
<member name="focus_previous" type="NodePath" setter="set_focus_previous" getter="get_focus_previous" default="NodePath("")">
|
||||
Tells Godot which node it should give keyboard focus to if the user presses [kbd]Shift + Tab[/kbd] on a keyboard by default. You can change the key by editing the [code]ui_focus_prev[/code] input action.
|
||||
Tells Godot which node it should give focus to if the user presses [kbd]Shift + Tab[/kbd] on a keyboard by default. You can change the key by editing the [code]ui_focus_prev[/code] input action.
|
||||
If this property is not set, Godot will select a "best guess" based on surrounding nodes in the scene tree.
|
||||
</member>
|
||||
<member name="grow_horizontal" type="int" setter="set_h_grow_direction" getter="get_h_grow_direction" enum="Control.GrowDirection" default="1">
|
||||
|
@ -873,12 +873,12 @@
|
|||
<signals>
|
||||
<signal name="focus_entered">
|
||||
<description>
|
||||
Emitted when the node gains keyboard focus.
|
||||
Emitted when the node gains focus.
|
||||
</description>
|
||||
</signal>
|
||||
<signal name="focus_exited">
|
||||
<description>
|
||||
Emitted when the node loses keyboard focus.
|
||||
Emitted when the node loses focus.
|
||||
</description>
|
||||
</signal>
|
||||
<signal name="gui_input">
|
||||
|
@ -934,7 +934,7 @@
|
|||
The node can only grab focus on mouse clicks. Use with [member focus_mode].
|
||||
</constant>
|
||||
<constant name="FOCUS_ALL" value="2" enum="FocusMode">
|
||||
The node can grab focus on mouse click or using the arrows and the Tab keys on the keyboard. Use with [member focus_mode].
|
||||
The node can grab focus on mouse click, using the arrows and the Tab keys on the keyboard, or using the D-pad buttons on a gamepad. Use with [member focus_mode].
|
||||
</constant>
|
||||
<constant name="NOTIFICATION_RESIZED" value="40">
|
||||
Sent when the node changes size. Use [member rect_size] to get the new size.
|
||||
|
|
Loading…
Reference in a new issue