Update winit to 0.22

This commit is contained in:
Héctor Ramón Jiménez 2020-03-09 22:35:25 +01:00
parent 5a91b52ef4
commit aac7ad3e14
3 changed files with 9 additions and 14 deletions

View file

@ -10,7 +10,7 @@ use iced_wgpu::{
use iced_winit::{winit, Cache, Clipboard, MouseCursor, Size, UserInterface};
use winit::{
event::{DeviceEvent, Event, ModifiersState, WindowEvent},
event::{Event, ModifiersState, WindowEvent},
event_loop::{ControlFlow, EventLoop},
};
@ -66,14 +66,11 @@ pub fn main() {
*control_flow = ControlFlow::Wait;
match event {
Event::DeviceEvent {
event: DeviceEvent::ModifiersChanged(new_modifiers),
..
} => {
modifiers = new_modifiers;
}
Event::WindowEvent { event, .. } => {
match event {
WindowEvent::ModifiersChanged(new_modifiers) => {
modifiers = new_modifiers;
}
WindowEvent::Resized(new_size) => {
logical_size =
new_size.to_logical(window.scale_factor());
@ -82,6 +79,7 @@ pub fn main() {
WindowEvent::CloseRequested => {
*control_flow = ControlFlow::Exit;
}
_ => {}
}