Skip to content

Improve documentation on _input_event 2d and 3d#120659

Open
leandro-benedet-garcia wants to merge 1 commit into
godotengine:masterfrom
leandro-benedet-garcia:_input_event
Open

Improve documentation on _input_event 2d and 3d#120659
leandro-benedet-garcia wants to merge 1 commit into
godotengine:masterfrom
leandro-benedet-garcia:_input_event

Conversation

@leandro-benedet-garcia

Copy link
Copy Markdown
Contributor

The old description for _input_event provided no near enough information about those methods and signals considering how much it actually can do, or does in general.

So I delved into the source code and tested behaviors in general to see how it actually worked, and I might still be missing something.

It might be worth mentioning also about https://docs.godotengine.org/en/stable/classes/class_projectsettings.html#class-projectsettings-property-input-devices-pointing-emulate-mouse-from-touch but I am not exactly sure how to phrase it.

@leandro-benedet-garcia leandro-benedet-garcia requested a review from a team as a code owner June 26, 2026 05:05
@AThousandShips AThousandShips requested a review from a team June 26, 2026 07:52
@AThousandShips AThousandShips added this to the 4.x milestone Jun 26, 2026

@AThousandShips AThousandShips left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And same for the 3D one

Comment thread doc/classes/CollisionObject2D.xml Outdated
[InputEventScreenDrag] for when drag passes through the object via touchscreen, when starting or not at the object.
[param viewport] is the [Viewport] that the event originated, for other viewports other than the main one to be detected, [member Viewport.physics_object_picking] needs to be set to true.
[param shape_idx] is the child index of the clicked [Shape2D]. This is unrelated to the scene tree, this value comes from the physics server, to properly use the index you need to use the methods related to them from [PhysicsServer2D].
See also [method Node._unhandled_input]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
See also [method Node._unhandled_input]
See also [method Node._unhandled_input].

Comment thread doc/classes/CollisionObject2D.xml Outdated
[InputEventMouseButton] for when a mouse button is pressed.
[InputEventScreenTouch] for when the object is pressed via a touchscreen.
[InputEventScreenDrag] for when drag passes through the object via touchscreen, when starting or not at the object.
[param viewport] is the [Viewport] that the event originated, for other viewports other than the main one to be detected, [member Viewport.physics_object_picking] needs to be set to true.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[param viewport] is the [Viewport] that the event originated, for other viewports other than the main one to be detected, [member Viewport.physics_object_picking] needs to be set to true.
[param viewport] is the [Viewport] that the event originated in, for viewports other than the main one to be detected, [member Viewport.physics_object_picking] needs to be set to [code]true[/code].

Comment thread doc/classes/CollisionObject2D.xml Outdated
<param index="2" name="shape_idx" type="int" />
<description>
Accepts unhandled [InputEvent]s. [param shape_idx] is the child index of the clicked [Shape2D]. Connect to [signal input_event] to easily pick up these events.
Detects unhandled Mouse and Touch [InputEvent]s through [param event] when events happen on top of the object. The events are:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Detects unhandled Mouse and Touch [InputEvent]s through [param event] when events happen on top of the object. The events are:
Detects unhandled mouse and touch [InputEvent]s through [param event] when events happen on top of the object. The events are:

Also don't think "on top of" is the best phrasing here

Comment thread doc/classes/CollisionObject2D.xml Outdated
[InputEventMouseMotion] for when the mouse moves.
[InputEventMouseButton] for when a mouse button is pressed.
[InputEventScreenTouch] for when the object is pressed via a touchscreen.
[InputEventScreenDrag] for when drag passes through the object via touchscreen, when starting or not at the object.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when starting or not at the object

What does this mean?

Comment thread doc/classes/CollisionObject2D.xml Outdated
[InputEventScreenTouch] for when the object is pressed via a touchscreen.
[InputEventScreenDrag] for when drag passes through the object via touchscreen, when starting or not at the object.
[param viewport] is the [Viewport] that the event originated, for other viewports other than the main one to be detected, [member Viewport.physics_object_picking] needs to be set to true.
[param shape_idx] is the child index of the clicked [Shape2D]. This is unrelated to the scene tree, this value comes from the physics server, to properly use the index you need to use the methods related to them from [PhysicsServer2D].

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unnecessarily verbose and vague IMO

@AThousandShips AThousandShips changed the title improve documentation on _input_event 2d and 3d Improve documentation on _input_event 2d and 3d Jun 26, 2026
@AThousandShips AThousandShips requested a review from a team June 26, 2026 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants