Commit 44d6898e authored by William's avatar William

Add Control, ShiftL, ShiftR, and Alt

parent 4fc7608e
Pipeline #3760 passed with stages
in 7 minutes and 7 seconds
......@@ -163,6 +163,10 @@ impl Backend for OrbitalBackend {
orbclient::K_DOWN => Key::Down,
orbclient::K_LEFT => Key::Left,
orbclient::K_RIGHT => Key::Right,
orbclient::K_CTRL => Key::Control,
orbclient::K_LEFT_SHIFT => Key::ShiftL,
orbclient::K_RIGHT_SHIFT => Key::ShiftR,
orbclient::K_ALT => Key::Alt,
_ => match key_event.character {
'\n' => Key::Enter,
_ => Key::from(key_event.character),
......
......@@ -14,6 +14,10 @@ pub enum Key {
Right,
Space,
Enter,
Control,
ShiftL,
ShiftR,
Alt,
A(bool),
B(bool),
C(bool),
......@@ -322,7 +326,7 @@ pub trait KeyDownHandler: Sized + Widget {
/// Inserts a handler.
fn on_key_down<H: Fn(Key) -> bool + 'static>(self, handler: H) -> Self {
self.insert_handler(KeyDownEventHandler {
handler: Rc::new(handler)
handler: Rc::new(handler),
})
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment