We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Event::WindowEvent { event: WindowEvent::KeyboardInput { input, .. }, window_id, } if window_id == window.id() => { if input.virtual_keycode == Some(VirtualKeyCode::Escape) { *control_flow = ControlFlow::Exit } }
The text was updated successfully, but these errors were encountered:
In newer versions of winit (0.29) this is done slightly differently:
event_loop.run(|event, control_target| { control_target.set_control_flow(ControlFlow::Poll); match event { Event::WindowEvent { event, .. } => match event { WindowEvent::CloseRequested => control_target.exit(), ... } ...
I.e., you can replace *control_flow = ControlFlow::Exit with control_target.exit().
*control_flow = ControlFlow::Exit
control_target.exit()
Sorry, something went wrong.
No branches or pull requests
The text was updated successfully, but these errors were encountered: