INNER CODE UNIT · Rust

bevy_key_to_egui

wkwan/flo · src/egui_integration.rs:194

fn bevy_key_to_egui(key: KeyCode) -> Option<egui::Key> {
    match key {
        KeyCode::Space => Some(egui::Key::Space),
        KeyCode::Enter => Some(egui::Key::Enter),
        KeyCode::Tab => Some(egui::Key::Tab),
        KeyCode::Backspace => Some(egui::Key::Backspace),
        KeyCode::Delete => Some(egui::Key::Delete),
        KeyCode::ArrowLeft => Some(egui::Key::ArrowLeft),
        KeyCode::ArrowRight => Some(egui::Key::ArrowRight),
        KeyCode::ArrowUp => Some(egui::Key::ArrowUp),
        KeyCode::ArrowDown => Some(egui::Key::ArrowDown),
        KeyCode::Home => Some(egui::Key::Home),
        KeyCode::End => Some(egui::Key::End),
        KeyCode::PageUp => Some(egui::Key::PageUp),
        KeyCode::PageDown => Some(egui::Key::PageDown),
        KeyCode::Escape => Some(egui::Key::Escape),
        _ => None,
    }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…