Rename DeviceEventFilter to DeviceEvents

The use of `Filter` was confusing so it was removed inverting the 
behavior of the enum and methods using it.

Co-authored-by: Kirill Chibisov <contact@kchibisov.com>
This commit is contained in:
Toniman575 2023-05-30 21:32:31 +02:00 committed by GitHub
parent de5327477a
commit 8bb004a1d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 43 additions and 51 deletions

View file

@ -30,9 +30,7 @@ use crate::{
dpi::{PhysicalPosition, PhysicalSize, Position, Size},
error::{ExternalError, NotSupportedError, OsError as RootOsError},
event::{Event, KeyEvent},
event_loop::{
ControlFlow, DeviceEventFilter, EventLoopClosed, EventLoopWindowTarget as RootELW,
},
event_loop::{ControlFlow, DeviceEvents, EventLoopClosed, EventLoopWindowTarget as RootELW},
icon::Icon,
keyboard::{Key, KeyCode},
platform::{modifier_supplement::KeyEventExtModifierSupplement, scancode::KeyCodeExtScancode},
@ -894,12 +892,12 @@ impl<T> EventLoopWindowTarget<T> {
}
#[inline]
pub fn set_device_event_filter(&self, _filter: DeviceEventFilter) {
pub fn listen_device_events(&self, _allowed: DeviceEvents) {
match *self {
#[cfg(wayland_platform)]
EventLoopWindowTarget::Wayland(_) => (),
#[cfg(x11_platform)]
EventLoopWindowTarget::X(ref evlp) => evlp.set_device_event_filter(_filter),
EventLoopWindowTarget::X(ref evlp) => evlp.set_listen_device_events(_allowed),
}
}