bevy icon indicating copy to clipboard operation
bevy copied to clipboard

Enter key treated as character E when `Window::prevent_default_event_handling` is `false`

Open johanhelsing opened this issue 2 years ago • 1 comments

Bevy version

main: 52f06175, a060639

Relevant system information

  • wasm, windows, firefox 110.0

What you did

  1. Set Window::prevent_default_event_handling to false
  2. Add logging for EventReader<ReceivedCharacter>
  3. cargo run --target wasm32-unknown-unknown
  4. Open browser
  5. Press enter key
  6. Open console log
INFO examples/input/keyboard_input_events.rs:35 ReceivedCharacter { window: 0v0, char: 'E' }

https://github.com/bevyengine/bevy/compare/main...johanhelsing:bevy:received-character-e-main?expand=1

What went wrong

Enter gets treated as the character E. We should not get ReceivedCharacter events when enter is pressed.

Additional information

This is a bug in winit. I've submitted a PR here: https://github.com/rust-windowing/winit/pull/2673

Not really sure if there's anything we could/should do to work around it. Creating an issue mostly to track this, and alert people that this is something already investigated in case it doesn't make it in time for bevy 0.10.

johanhelsing avatar Feb 23 '23 07:02 johanhelsing

The winit issue says it's fixed. Can this be closed?

benfrankel avatar Jul 09 '24 18:07 benfrankel