INNER CODE UNIT · Rust
update_egui_input
wkwan/flo · src/egui_integration.rs:114
pub fn update_egui_input(
mut egui_ctx: ResMut<EguiContext>,
windows: Query<&Window>,
time: Res<Time>,
mouse_button_input: Res<ButtonInput<MouseButton>>,
keyboard_input: Res<ButtonInput<KeyCode>>,
) {
if let Ok(window) = windows.single() {
// Get the scale factor from the window and store it in the resource
let scale_factor = window.scale_factor();
egui_ctx.scale_factor = scale_factor;
let raw_input = &mut egui_ctx.raw_input;
// Update screen rect using physical dimensions to fill the entire window
raw_input.screen_rect = Some(egui::Rect::from_min_size(
egui::Pos2::ZERO,