|
|
|
@ -138,15 +138,16 @@ fn main() {
|
|
|
|
|
} if window_id == window.id() => {
|
|
|
|
|
if !state.input(event) {
|
|
|
|
|
match event {
|
|
|
|
|
WindowEvent::CloseRequested => *control_flow = ControlFlow::Exit,
|
|
|
|
|
WindowEvent::KeyboardInput { input, .. } => match input {
|
|
|
|
|
KeyboardInput {
|
|
|
|
|
state: ElementState::Pressed,
|
|
|
|
|
virtual_keycode: Some(VirtualKeyCode::Escape),
|
|
|
|
|
..
|
|
|
|
|
} => *control_flow = ControlFlow::Exit,
|
|
|
|
|
_ => {}
|
|
|
|
|
},
|
|
|
|
|
WindowEvent::CloseRequested
|
|
|
|
|
| WindowEvent::KeyboardInput {
|
|
|
|
|
input:
|
|
|
|
|
KeyboardInput {
|
|
|
|
|
state: ElementState::Pressed,
|
|
|
|
|
virtual_keycode: Some(VirtualKeyCode::Escape),
|
|
|
|
|
..
|
|
|
|
|
},
|
|
|
|
|
..
|
|
|
|
|
} => *control_flow = ControlFlow::Exit,
|
|
|
|
|
WindowEvent::Resized(physical_size) => {
|
|
|
|
|
state.resize(*physical_size);
|
|
|
|
|
}
|
|
|
|
|