Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.x] Document that Input.is_action should not be used during input-handling #97574

Merged
merged 1 commit into from
Sep 29, 2024

Conversation

lawnjelly
Copy link
Member

@lawnjelly lawnjelly commented Sep 28, 2024

In most cases InputEvent.is_action* is more appropriate during input-handling.

Backport of #80185 .
Helps address #97526 .
Helps address #80158 .

Notes

  • This confusion has come up in master and 3.x.
  • Whether to go forward with this depends on whether we intend to use an alternative automated approach (e.g. Add scope parameter to Input.is_action_just_pressed() godot-proposals#10843)
  • Ideally this documentation would be used in combination with a WARN_PRINT_ONCE or similar if e.g. Input.is_action_just_pressed() is used withing _input(), but that should be a separate PR.

In most cases `InputEvent.is_action*` is more appropriate during input-handling.
@lawnjelly lawnjelly added this to the 3.7 milestone Sep 28, 2024
@lawnjelly lawnjelly requested a review from a team as a code owner September 28, 2024 06:22
@lawnjelly lawnjelly merged commit 361b0df into godotengine:3.x Sep 29, 2024
14 checks passed
@lawnjelly
Copy link
Member Author

Will merge this for now, if we do change to an automated approach, this will be easy to change.

@lawnjelly lawnjelly deleted the doc_input_pressed branch September 29, 2024 06:18
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.

3 participants