pub fn write_window_pointer_moved_events_system(
    mut cursor_moved_reader: EventReader<CursorMoved>,
    mut egui_input_event_writer: EventWriter<EguiInputEvent>,
    mut egui_contexts: Query<
        (&EguiContextSettings, &mut EguiContextPointerPosition),
        (With<EguiContext>, With<Window>),
    >,
) {
    for event in cursor_moved_reader.read() {
        let Some((context_settings, mut context_pointer_position)) =
            egui_contexts.get_some_mut(event.window)
        else {
            continue;
        };

        if !context_settings
            .input_system_settings
            .run_write_window_pointer_moved_events_system
        {
            continue;
        }

        let scale_factor = context_settings.scale_factor;
        let pointer_position = vec2_into_egui_pos2(event.position / scale_factor);
        context_pointer_position.position = pointer_position;
        egui_input_event_writer.write(EguiInputEvent {
            context: event.window,
            event: egui::Event::PointerMoved(pointer_position),
        });
    }
}
Reads [`MouseButtonInput`] events and wraps them into [`EguiInputEvent`] (only for window contexts).
src/input.rs