mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2024-10-29 21:42:26 +00:00
Fix the multi-window example handling every key event (#2589)
This commit is contained in:
parent
50b3b7a42f
commit
43a298e1ab
@ -45,6 +45,7 @@ use winit::{
|
||||
application::ApplicationHandler,
|
||||
event::{ElementState, KeyEvent, WindowEvent},
|
||||
event_loop::{ActiveEventLoop, EventLoop},
|
||||
keyboard::{Key, NamedKey},
|
||||
window::{Window, WindowId},
|
||||
};
|
||||
|
||||
@ -52,6 +53,8 @@ fn main() -> Result<(), impl Error> {
|
||||
let event_loop = EventLoop::new().unwrap();
|
||||
let mut app = App::new(&event_loop);
|
||||
|
||||
println!("\nPress space to open a new window");
|
||||
|
||||
event_loop.run_app(&mut app)
|
||||
}
|
||||
|
||||
@ -365,6 +368,7 @@ impl ApplicationHandler for App {
|
||||
WindowEvent::KeyboardInput {
|
||||
event:
|
||||
KeyEvent {
|
||||
logical_key: Key::Named(NamedKey::Space),
|
||||
state: ElementState::Pressed,
|
||||
..
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user