Skip to content

Commit

Permalink
Rework input handling (#345)
Browse files Browse the repository at this point in the history
* Refactor input systems (closes #173)

* Add color_test example

* Add support for redirecting events to non-window contexts

* Actually respect EguiGlobalSettings

* Remove web_sys_unstable_apis, fix docs and tests

* Fix windows build

* Disable the headless test (broken after a Bevy update)
  • Loading branch information
vladbat00 authored Jan 4, 2025
1 parent 960c0d6 commit c60a105
Show file tree
Hide file tree
Showing 16 changed files with 2,609 additions and 1,263 deletions.
4 changes: 0 additions & 4 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
[alias]
run-wasm = ["run", "--release", "--package", "run-wasm", "--"]

# Using unstable APIs is required for writing to clipboard
[target.wasm32-unknown-unknown]
rustflags = ["--cfg=web_sys_unstable_apis"]
2 changes: 0 additions & 2 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ jobs:
"render",
"manage_clipboard,open_url,render",
]
env:
RUSTFLAGS: --cfg=web_sys_unstable_apis
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
Expand Down
16 changes: 10 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ serde = ["egui/serde"]
# The enabled logs will print with the info log level, to make it less cumbersome to debug in browsers.
log_input_events = []

[[example]]
name = "color_test"
required-features = ["render"]
[[example]]
name = "paint_callback"
required-features = ["render"]
Expand All @@ -58,7 +61,7 @@ name = "ui"
required-features = ["render"]
[[example]]
name = "render_egui_to_image"
required-features = ["render"]
required-features = ["render", "bevy/bevy_gizmos"]

[dependencies]
egui = { version = "0.30", default-features = false }
Expand Down Expand Up @@ -94,16 +97,17 @@ thread_local = { version = "1.1.0", optional = true }
[dev-dependencies]
version-sync = "0.9.4"
bevy = { version = "0.15.0", default-features = false, features = [
"x11",
"png",
"bevy_pbr",
"bevy_core_pipeline",
"bevy_asset",
"bevy_core_pipeline",
"bevy_sprite",
"bevy_pbr",
"bevy_window",
"bevy_winit",
"android-game-activity",
"png",
"tonemapping_luts",
"webgl2",
"android-game-activity",
"x11",
] }
egui = { version = "0.30", default-features = false, features = ["bytemuck"] }

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugins(EguiPlugin)
// Systems that create Egui widgets should be run during the `CoreSet::Update` set,
// or after the `EguiSet::BeginPass` system (which belongs to the `CoreSet::PreUpdate` set).
// Systems that create Egui widgets should be run during the `Update` Bevy schedule,
// or after the `EguiPreUpdateSet::BeginPass` system (which belongs to the `PreUpdate` Bevy schedule).
.add_systems(Update, ui_example_system)
.run();
}
Expand Down
3 changes: 0 additions & 3 deletions build.rs

This file was deleted.

Loading

0 comments on commit c60a105

Please sign in to comment.