Support ReceivedCharacter event

This commit is contained in:
Héctor Ramón Jiménez 2019-06-25 21:18:11 +02:00
parent 8ad078b964
commit 8f66d96915
3 changed files with 23 additions and 8 deletions

View file

@ -80,6 +80,14 @@ impl<T> WindowTarget<T> {
});
});
let runner = self.runner.clone();
canvas.on_key_press(move |char_code| {
runner.send_event(Event::WindowEvent {
window_id: WindowId(window::Id),
event: WindowEvent::ReceivedCharacter(char_code),
});
});
let runner = self.runner.clone();
canvas.on_mouse_out(move |pointer_id| {
runner.send_event(Event::WindowEvent {