pub fn write_web_clipboard_events_system(
    focused_non_window_egui_context: Option<Res<FocusedNonWindowEguiContext>>,
    // We can safely assume that we have only 1 window in WASM.
    egui_context: Single<(Entity, &EguiContextSettings), (With<PrimaryWindow>, With<EguiContext>)>,
    mut egui_clipboard: ResMut<EguiClipboard>,
    mut egui_input_event_writer: EventWriter<EguiInputEvent>,
) {
    let (primary_context, context_settings) = *egui_context;
    if !context_settings
        .input_system_settings
        .run_write_web_clipboard_events_system
    {
        return;
    }

    let context = focused_non_window_egui_context
        .as_deref()
        .map_or(primary_context, |context| context.0);
    while let Some(event) = egui_clipboard.try_receive_clipboard_event() {
        match event {
            crate::web_clipboard::WebClipboardEvent::Copy => {
                egui_input_event_writer.write(EguiInputEvent {
                    context,
                    event: egui::Event::Copy,
                });
            }
            crate::web_clipboard::WebClipboardEvent::Cut => {
                egui_input_event_writer.write(EguiInputEvent {
                    context,
                    event: egui::Event::Cut,
                });
            }
            crate::web_clipboard::WebClipboardEvent::Paste(text) => {
                egui_clipboard.set_text_internal(&text);
                egui_input_event_writer.write(EguiInputEvent {
                    context,
                    event: egui::Event::Paste(text),
                });
            }
        }
    }
}
Receives web clipboard events and wraps them as [`EguiInputEvent`] events.
src/web_clipboard.rs