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

Document ButtonInput behavior regarding window focus #12367

Merged
merged 2 commits into from
Mar 8, 2024

Conversation

SpecificProtagonist
Copy link
Contributor

@SpecificProtagonist SpecificProtagonist commented Mar 7, 2024

Objective

ButtonInput<KeyCode> documentation is currently incorrect/incomplete, see #12273.

Solution

Fix the documentation.

I think in the future we should also stop triggering just_pressed/just_released when focus switches between two Bevy windows, as those functions are independent of the window. It could also make sense to add individual ButtonInput<KeyCode>s per window.

Copy link
Member

@matiqo15 matiqo15 left a comment

Choose a reason for hiding this comment

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

Just some suggestions, overall looks good!

crates/bevy_input/src/button_input.rs Outdated Show resolved Hide resolved
Co-authored-by: Mateusz Wachowiak <[email protected]>
@alice-i-cecile alice-i-cecile added C-Docs An addition or correction to our documentation A-Input Player input via keyboard, mouse, gamepad, and more A-Windowing Platform-agnostic interface layer to run your app in labels Mar 7, 2024
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

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

Cursed, but a useful note for now.

@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Mar 7, 2024
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Mar 8, 2024
Merged via the queue into bevyengine:main with commit da25f1d Mar 8, 2024
29 checks passed
spectria-limina pushed a commit to spectria-limina/bevy that referenced this pull request Mar 9, 2024
# Objective

`ButtonInput<KeyCode>` documentation is currently incorrect/incomplete,
see bevyengine#12273.

## Solution

Fix the documentation.

I think in the future we should also stop triggering
`just_pressed`/`just_released` when focus switches between two Bevy
windows, as those functions are independent of the window. It could also
make sense to add individual `ButtonInput<KeyCode>`s per window.

---------

Co-authored-by: Mateusz Wachowiak <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Input Player input via keyboard, mouse, gamepad, and more A-Windowing Platform-agnostic interface layer to run your app in C-Docs An addition or correction to our documentation S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants