Conversation
|
The changes of the upstream PR (Bevy #10644) breaks the compilation of |
/// Sets up the pipeline for newly created windows.
pub fn setup_new_windows_render_system(
windows: Extract<Query<Entity, Added<Window>>>,
mut render_graph: ResMut<RenderGraph>,
) {
#[derive(Debug, Hash, PartialEq, Eq, Clone, RenderLabel)]
struct EguiPass(String);
for window in windows.iter() {
let egui_pass = EguiPass(format!("egui-{}-{}", window.index(), window.generation()));
let new_node = EguiNode::new(window);
render_graph.add_node(egui_pass.clone(), new_node);
render_graph.add_node_edge(bevy::render::graph::CameraDriverLabel, egui_pass);
}
}This works and successfully passed all of four tests in bevy_egui, which have limited coverage. I'm not entirely certain that all behaviors are error-free. Update: #[derive(Debug, Hash, PartialEq, Eq, Clone, RenderLabel)]
struct EguiPass(u32, u32);
let egui_pass = EguiPass(window.index(), window.generation()); |
I think it would be faster to make the label directly use index and generation, which would remove num to str conversion |
|
updated to bevy main if that's useful: https://github.com/eerii/bevy_egui/pull/2 |
src/systems.rs
Outdated
| #[cfg(all(feature = "manage_clipboard", not(target_os = "android")))] | ||
| pub egui_clipboard: Res<'w, crate::EguiClipboard>, | ||
| pub keyboard_input: Res<'w, Input<KeyCode>>, | ||
| pub keyboard_input: Res<'w, ButtonInput<KeyCode>>, |
There was a problem hiding this comment.
We'll want to read the event KeyboardInput, as KeyCode in bevy is no longer layout dependant.
Maybe it could be done in a followup issue?
There was a problem hiding this comment.
@Vrixyz do we want these inputs to be layout dependent? We are reading them only to check key modifiers (such as shift/ctrl/etc).
There was a problem hiding this comment.
Modifiers aren't exempt from keyboard layout, prominently many layouts have AltGraph instead of AltRight. Less industry-standard but still out there Neo replaces capslock and the key right of left shift (that US layouts don't have) with modifiers.
It may not have a huge practical impact and people with those kinds of layout are already accustomed to additional pain (compared to say plain dvorak) but consistently using logical mappings sounds like a good idea.
There was a problem hiding this comment.
@eerii you might be interested in parts of that diff: ThierryBerger@86650bb ; I think that's not the whole diff needed to use logical key everywhere, but it was enough to get me unlock on my particular issue.
I look forward to finally consolidate bevy_egui to non-qwerty layouts :D
(Just when I ordered a qwerty keyboard 🥲)
There was a problem hiding this comment.
I updated the branch to match main and to track the latest bevy main, and added your diff. It seems to work and while I'm not sure where else to look to migrate logical input it seems an improvement! Thanks ^^
Edit: Not sure how to change the keycode into a keyboardinto yet, I will look into it
There was a problem hiding this comment.
It's a bit of a shame that Bevy 0.13 doesn't have ButtonInput<Key> for logical keys
There was a problem hiding this comment.
I've just re-implemented the modifiers logic with logical key codes, I'll keep this for review till the evening and then merge it. I also hope to tackle the other input-related issues shortly after and then release a new version.
Co-authored-by: Félix Lescaudey de Maneville <[email protected]>
|
Thank you @eerii and everyone else involved! ❤️ |
Blocked on: * [x] vladbat00/bevy_egui#236 * [x] jakobhellermann/bevy-inspector-egui#185
Blocking: * [x] dimforge/bevy_rapier#479 * [x] avianphysics/avian#315 * [x] vladbat00/bevy_egui#236 * [x] jakobhellermann/bevy-inspector-egui#185
Draft
Update to stay in sync with bevy
mainbranch. Some changes are:Inputhas been renamed toButtonInputcreate_bind_group_layoutnow takes two parameters instead of a structWorldqueries are revamped and now split intoQueryDataandQueryFilterImagenow has a newRenderAssetPersistencePolicyfieldEguiSettings::scale_factorchanged type fromf64tof32to match bevy'swindow_sizeThis pr is updated and tested until bevyengine/bevy@ebf81c6 (2024/02/14)
bevy-inspector-eguifork: https://github.com/eerii/bevy-inspector-eguiRelevant prs
WorldQueryData&WorldQueryFiltertoQueryData&QueryFilterbevyengine/bevy#10779Windowscale factor to f32 (adopted) bevyengine/bevy#10897bevy_render::mesh::shapebevyengine/bevy#11773