bevyengine / bevyengine/bevy

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

Open
#7,791 1 comment 1 reaction 0 assignees View on GitHub
A-Input A-Windowing C-Bug O-Web S-Blocked
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## 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`
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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.