|
|
@ -231,24 +231,26 @@ pub async fn run() {
|
|
|
|
|
|
|
|
|
|
|
|
let mut state = State::new(window).await;
|
|
|
|
let mut state = State::new(window).await;
|
|
|
|
|
|
|
|
|
|
|
|
event_loop.run(move |event, _, control_flow| match event {
|
|
|
|
event_loop.run(move |event, _, control_flow| {
|
|
|
|
Event::WindowEvent {
|
|
|
|
match event {
|
|
|
|
ref event,
|
|
|
|
Event::WindowEvent {
|
|
|
|
window_id,
|
|
|
|
ref event,
|
|
|
|
} if window_id == state.window().id() => match event {
|
|
|
|
window_id,
|
|
|
|
WindowEvent::CloseRequested
|
|
|
|
} if window_id == state.window().id() => match event {
|
|
|
|
| WindowEvent::KeyboardInput {
|
|
|
|
WindowEvent::CloseRequested
|
|
|
|
input:
|
|
|
|
| WindowEvent::KeyboardInput {
|
|
|
|
KeyboardInput {
|
|
|
|
input:
|
|
|
|
state: ElementState::Pressed,
|
|
|
|
KeyboardInput {
|
|
|
|
virtual_keycode: Some(VirtualKeyCode::Escape),
|
|
|
|
state: ElementState::Pressed,
|
|
|
|
..
|
|
|
|
virtual_keycode: Some(VirtualKeyCode::Escape),
|
|
|
|
},
|
|
|
|
..
|
|
|
|
..
|
|
|
|
},
|
|
|
|
} => *control_flow = ControlFlow::Exit,
|
|
|
|
..
|
|
|
|
|
|
|
|
} => *control_flow = ControlFlow::Exit,
|
|
|
|
|
|
|
|
_ => {}
|
|
|
|
|
|
|
|
},
|
|
|
|
_ => {}
|
|
|
|
_ => {}
|
|
|
|
},
|
|
|
|
}
|
|
|
|
_ => {}
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
```
|
|
|
|