mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 05:10:03 -04:00
Add all alpha-numeric keys to egui::Key
Closes https://github.com/emilk/egui/issues/91
This commit is contained in:
@@ -165,26 +165,60 @@ pub fn translate_virtual_key_code(key: VirtualKeyCode) -> Option<egui::Key> {
|
||||
use VirtualKeyCode::*;
|
||||
|
||||
Some(match key {
|
||||
Escape => Key::Escape,
|
||||
Insert => Key::Insert,
|
||||
Home => Key::Home,
|
||||
Delete => Key::Delete,
|
||||
End => Key::End,
|
||||
PageDown => Key::PageDown,
|
||||
PageUp => Key::PageUp,
|
||||
Left => Key::ArrowLeft,
|
||||
Up => Key::ArrowUp,
|
||||
Right => Key::ArrowRight,
|
||||
Down => Key::ArrowDown,
|
||||
Left => Key::ArrowLeft,
|
||||
Right => Key::ArrowRight,
|
||||
Up => Key::ArrowUp,
|
||||
|
||||
Escape => Key::Escape,
|
||||
Tab => Key::Tab,
|
||||
Back => Key::Backspace,
|
||||
Return => Key::Enter,
|
||||
Tab => Key::Tab,
|
||||
Space => Key::Space,
|
||||
|
||||
Insert => Key::Insert,
|
||||
Delete => Key::Delete,
|
||||
Home => Key::Home,
|
||||
End => Key::End,
|
||||
PageUp => Key::PageUp,
|
||||
PageDown => Key::PageDown,
|
||||
|
||||
Key0 | Numpad0 => Key::Num0,
|
||||
Key1 | Numpad1 => Key::Num1,
|
||||
Key2 | Numpad2 => Key::Num2,
|
||||
Key3 | Numpad3 => Key::Num3,
|
||||
Key4 | Numpad4 => Key::Num4,
|
||||
Key5 | Numpad5 => Key::Num5,
|
||||
Key6 | Numpad6 => Key::Num6,
|
||||
Key7 | Numpad7 => Key::Num7,
|
||||
Key8 | Numpad8 => Key::Num8,
|
||||
Key9 | Numpad9 => Key::Num9,
|
||||
|
||||
A => Key::A,
|
||||
B => Key::B,
|
||||
C => Key::C,
|
||||
D => Key::D,
|
||||
E => Key::E,
|
||||
F => Key::F,
|
||||
G => Key::G,
|
||||
H => Key::H,
|
||||
I => Key::I,
|
||||
J => Key::J,
|
||||
K => Key::K,
|
||||
L => Key::L,
|
||||
M => Key::M,
|
||||
N => Key::N,
|
||||
O => Key::O,
|
||||
P => Key::P,
|
||||
Q => Key::Q,
|
||||
R => Key::R,
|
||||
S => Key::S,
|
||||
T => Key::T,
|
||||
U => Key::U,
|
||||
V => Key::V,
|
||||
W => Key::W,
|
||||
X => Key::X,
|
||||
Y => Key::Y,
|
||||
Z => Key::Z,
|
||||
|
||||
_ => {
|
||||
|
||||
Reference in New Issue
Block a user