bevy/crates/bevy_winit/src
HugoPeters1024 b9cc6e16da
bevy_winit(emit raw winit events) (#15884)
# Objective

- Exposes raw winit events making Bevy even more modular and powerful
for custom plugin developers (e.g. a custom render plugin).

XRef: https://github.com/bevyengine/bevy/issues/5977
It doesn't quite close the issue as sending events is not supported (or
not very useful to be precise). I would think that supporting that
requires some extra considerations by someone a bit more familiar with
the `bevy_winit` crate. That said, this PR could be a nice step forward.

## Solution

Emit `RawWinitWindowEvent` objects for each received event.

## Testing

I verified that the events are emitted using a basic test app. I don't
think it makes sense to solidify this behavior in one of the examples.

---

## Showcase

My example usage for a custom `egui_winit` integration:

```rust
for ev in winit_events.read() {
    if ev.window_id == window.id {
        let _ = egui_winit.on_window_event(&window, &ev.event);
    }
}
```

---------

Co-authored-by: IceSentry <IceSentry@users.noreply.github.com>
2024-12-03 17:20:43 +00:00
..
accessibility.rs Remove accesskit re-export from bevy_a11y (#16257) 2024-11-08 21:01:16 +00:00
converters.rs Correctly feature gate custom_cursor (#16093) 2024-11-02 01:47:32 +00:00
cursor.rs properly flag using CustomCursor::Url in wasm (#16255) 2024-11-06 13:14:12 +00:00
lib.rs bevy_winit(emit raw winit events) (#15884) 2024-12-03 17:20:43 +00:00
state.rs bevy_winit(emit raw winit events) (#15884) 2024-12-03 17:20:43 +00:00
system.rs Reduce iOS cpu usage (#16548) 2024-11-29 00:34:40 +00:00
winit_config.rs Reduce iOS cpu usage (#16548) 2024-11-29 00:34:40 +00:00
winit_monitors.rs Simpler lint fixes: makes ci lints work but disables a lint for now (#15376) 2024-09-24 11:42:59 +00:00
winit_windows.rs Handle failed cursor grab mode changes so that the cursor grab mode change can be attempted again (#16293) 2024-11-09 23:30:57 +00:00