Allow read-write access to raw WindowEvents within Bevy apps
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 171
Description
## What problem does this solve or what need does it fill?
While working on an input capture and playback library, @plof27 pointed out that I may be able to capture raw events from `winit` directly, rather than dealing with the separated event streams.
Unfortunately, the necessary `WindowEvent` type is not exposed in [`winit_runner_with`](https://github.com/bevyengine/bevy/blob/1914696a24f33ee3abc18effd1a7b14f4f303b82/crates/bevy_winit/src/lib.rs#L339), our `winit`-based app runner.
## What solution would you like?
1. Allow users to read the full list of raw window events sent.
2. Allow users to send raw window events from within systems, which are then processed by the `winit` loop.
These should be exposed as a simple `Events`; the complexity comes from ensuring that `winit_runner_with` responds appropriately.
## What alternative(s) have you considered?
I've considered exposing this with a custom runner, however #4537 means this is a tedious and duplication-heavy task.
Contributor guide
Research direction
Start in crates/bevy_winit/src/lib.rs at winit_runner_with and review how the winit-based app runner handles WindowEvent values. The work is complete when users can read raw window events and send them from systems, with those sent events processed by the winit loop.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- game-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100