diff --git a/voxygen/src/window.rs b/voxygen/src/window.rs index 8173151180..fd1e62ae04 100644 --- a/voxygen/src/window.rs +++ b/voxygen/src/window.rs @@ -469,7 +469,7 @@ impl Window { let scale_factor = window.scale_factor(); - let key_layout = match init_keylayout_from_window(&window) { + let key_layout = match KeyLayout::new_from_window(&window) { Ok(kl) => Some(kl), Err(err) => { warn!( @@ -1390,30 +1390,3 @@ impl Default for FullScreenSettings { } } } - -use keyboard_keynames::errors::KeyLayoutError; - -fn init_keylayout_from_window( - _window: &winit::window::Window, -) -> Result { - #[cfg(target_family = "unix")] - { - use keyboard_keynames::key_layout::KeyLayoutExtUnix; - use winit::platform::unix::WindowExtUnix; - - match _window.xcb_connection() { - Some(_) => KeyLayout::new_x11(), - None => KeyLayout::new_wayland(), - } - } - - #[cfg(target_family = "windows")] - { - Ok(KeyLayout {}) - } - - #[cfg(all(not(target_family = "unix"), not(target_family = "windows")))] - { - Err(KeyLayoutError::PlatformUnsupportedError) - } -}