Skip to content

Document ButtonInput behavior regarding window focus#12367

Merged
alice-i-cecile merged 2 commits intobevyengine:mainfrom
SpecificProtagonist:button-input
Mar 8, 2024
Merged

Document ButtonInput behavior regarding window focus#12367
alice-i-cecile merged 2 commits intobevyengine:mainfrom
SpecificProtagonist:button-input

Conversation

@SpecificProtagonist
Copy link
Copy Markdown
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
Copy Markdown
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!

Co-authored-by: Mateusz Wachowiak <mateusz_wachowiak@outlook.com>
@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
Copy Markdown
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
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 <mateusz_wachowiak@outlook.com>
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