Make set_device_event_filter non-mut

Commit f10a984 added `EventLoopWindowTarget::set_device_event_filter`
with for a mutable reference, however most winit APIs work with
immutable references, so altering API to play nicely with existing APIs.

This also disables device event filtering on debug example.
This commit is contained in:
Kirill Chibisov
2022-06-10 15:39:02 +03:00
committed by GitHub
parent 10419ff441
commit eec84ade86
4 changed files with 12 additions and 10 deletions

View File

@@ -6,7 +6,7 @@ use simple_logger::SimpleLogger;
use winit::{
dpi::{LogicalSize, PhysicalSize},
event::{DeviceEvent, ElementState, Event, KeyboardInput, VirtualKeyCode, WindowEvent},
event_loop::EventLoop,
event_loop::{DeviceEventFilter, EventLoop},
window::{Fullscreen, WindowBuilder},
};
@@ -32,6 +32,8 @@ fn main() {
let mut minimized = false;
let mut visible = true;
event_loop.set_device_event_filter(DeviceEventFilter::Never);
event_loop.run(move |event, _, control_flow| {
control_flow.set_wait();