Expand description
§VirtualKeyboard for egui
Adds virtual keyboard to provided ui
Rcommended to use in separate window or panel
Example use with eframe:
use egui_virtual_keyboard::VirtualKeyboard;
pub struct ExampleApp {
label: String,
keyboard: VirtualKeyboard,
}
impl Default for ExampleApp {
fn default() -> Self {
Self {
label: "Hello World!".to_owned(),
keyboard: Default::default(),
}
}
}
impl eframe::App for ExampleApp {
fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
egui::CentralPanel::default().show(ctx, |ui| {
ui.horizontal(|ui| {
ui.label("Write something: ");
ui.text_edit_singleline(&mut self.label);
});
});
let scr_size = ctx.screen_rect().size();
egui::Window::new("KBD").show(ctx, |ui| {
self.keyboard.show(ui);
});
}
fn raw_input_hook(&mut self, ctx: &egui::Context, raw_input: &mut egui::RawInput) {
self.keyboard.bump_events(ctx, raw_input);
}
}
fn main() -> eframe::Result {
let native_options = eframe::NativeOptions::default();
eframe::run_native(
"eframe template",
native_options,
Box::new(|_cc| Ok(Box::new(ExampleApp::default()))),
)
}Structs§
- Button
- Single keyboard button
- Layout
- Named row sequence
- Parse
Button Error - Parse
KeyAction Error - Parse
Layout Error - Parse
Modifier Error - Parse
RowError - Row
- Holds a row of buttons
- State
- Keyboard’s state
- Virtual
Keyboard - A Keyboard, that can be drawn in egui.
Enums§
- KeyAction
- Keyboard key action
- ModState
- Modificator key state
- Modifier
- If this is not self explanatory, please read this Wikipedia article to gain general understanding.
- Parse
KeyAction Error Kind