Silence warnings about use of deprecated fields

This commit is contained in:
Murarth 2020-01-04 10:58:39 -07:00 committed by Osspial
parent d29f7f34aa
commit ac69a9c0dc
3 changed files with 9 additions and 0 deletions

View file

@ -341,6 +341,7 @@ impl<'a> WindowEvent<'a> {
input, input,
is_synthetic, is_synthetic,
}), }),
#[allow(deprecated)]
CursorMoved { CursorMoved {
device_id, device_id,
position, position,
@ -352,6 +353,7 @@ impl<'a> WindowEvent<'a> {
}), }),
CursorEntered { device_id } => Some(CursorEntered { device_id }), CursorEntered { device_id } => Some(CursorEntered { device_id }),
CursorLeft { device_id } => Some(CursorLeft { device_id }), CursorLeft { device_id } => Some(CursorLeft { device_id }),
#[allow(deprecated)]
MouseWheel { MouseWheel {
device_id, device_id,
delta, delta,
@ -363,6 +365,7 @@ impl<'a> WindowEvent<'a> {
phase, phase,
modifiers, modifiers,
}), }),
#[allow(deprecated)]
MouseInput { MouseInput {
device_id, device_id,
state, state,

View file

@ -54,6 +54,7 @@ pub fn init_keyboard(
}; };
let vkcode = key_to_vkey(rawkey, keysym); let vkcode = key_to_vkey(rawkey, keysym);
my_sink.send_window_event( my_sink.send_window_event(
#[allow(deprecated)]
WindowEvent::KeyboardInput { WindowEvent::KeyboardInput {
device_id: crate::event::DeviceId( device_id: crate::event::DeviceId(
crate::platform_impl::DeviceId::Wayland(DeviceId), crate::platform_impl::DeviceId::Wayland(DeviceId),
@ -96,6 +97,7 @@ pub fn init_keyboard(
let state = ElementState::Pressed; let state = ElementState::Pressed;
let vkcode = key_to_vkey(repeat_event.rawkey, repeat_event.keysym); let vkcode = key_to_vkey(repeat_event.rawkey, repeat_event.keysym);
repeat_sink.send_window_event( repeat_sink.send_window_event(
#[allow(deprecated)]
WindowEvent::KeyboardInput { WindowEvent::KeyboardInput {
device_id: crate::event::DeviceId(crate::platform_impl::DeviceId::Wayland( device_id: crate::event::DeviceId(crate::platform_impl::DeviceId::Wayland(
DeviceId, DeviceId,
@ -155,6 +157,7 @@ pub fn init_keyboard(
_ => unreachable!(), _ => unreachable!(),
}; };
my_sink.send_window_event( my_sink.send_window_event(
#[allow(deprecated)]
WindowEvent::KeyboardInput { WindowEvent::KeyboardInput {
device_id: crate::event::DeviceId( device_id: crate::event::DeviceId(
crate::platform_impl::DeviceId::Wayland(DeviceId), crate::platform_impl::DeviceId::Wayland(DeviceId),

View file

@ -561,6 +561,7 @@ impl<T: 'static> EventProcessor<T> {
let modifiers = self.device_mod_state.modifiers(); let modifiers = self.device_mod_state.modifiers();
#[allow(deprecated)]
callback(Event::WindowEvent { callback(Event::WindowEvent {
window_id, window_id,
event: WindowEvent::KeyboardInput { event: WindowEvent::KeyboardInput {
@ -1051,6 +1052,7 @@ impl<T: 'static> EventProcessor<T> {
let virtual_keycode = events::keysym_to_element(keysym as c_uint); let virtual_keycode = events::keysym_to_element(keysym as c_uint);
let modifiers = self.device_mod_state.modifiers(); let modifiers = self.device_mod_state.modifiers();
#[allow(deprecated)]
callback(Event::DeviceEvent { callback(Event::DeviceEvent {
device_id, device_id,
event: DeviceEvent::Key(KeyboardInput { event: DeviceEvent::Key(KeyboardInput {
@ -1203,6 +1205,7 @@ impl<T: 'static> EventProcessor<T> {
let keysym = wt.xconn.keycode_to_keysym(keycode); let keysym = wt.xconn.keycode_to_keysym(keycode);
let virtual_keycode = events::keysym_to_element(keysym as c_uint); let virtual_keycode = events::keysym_to_element(keysym as c_uint);
#[allow(deprecated)]
callback(Event::WindowEvent { callback(Event::WindowEvent {
window_id, window_id,
event: WindowEvent::KeyboardInput { event: WindowEvent::KeyboardInput {