Add Keyboard variant to canvas::Event

This commit is contained in:
Héctor Ramón Jiménez 2020-08-10 23:57:29 +02:00
parent 9ba4cfd23f
commit 00d66da0ce
4 changed files with 9 additions and 0 deletions

View File

@ -143,6 +143,7 @@ mod bezier {
}
_ => None,
},
_ => None,
}
}

View File

@ -413,6 +413,7 @@ mod grid {
},
_ => None,
},
_ => None,
}
}

View File

@ -173,6 +173,9 @@ where
iced_native::Event::Mouse(mouse_event) => {
Some(Event::Mouse(mouse_event))
}
iced_native::Event::Keyboard(keyboard_event) => {
Some(Event::Keyboard(keyboard_event))
}
_ => None,
};

View File

@ -1,3 +1,4 @@
use iced_native::keyboard;
use iced_native::mouse;
/// A [`Canvas`] event.
@ -7,4 +8,7 @@ use iced_native::mouse;
pub enum Event {
/// A mouse event.
Mouse(mouse::Event),
/// A keyboard event.
Keyboard(keyboard::Event),
}