diff --git a/Cargo.toml b/Cargo.toml index e0a2458fcf..b43c038ba3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,7 +36,7 @@ rustdoc-args = ["--cfg", "docsrs"] [features] default = ["x11", "wayland", "wayland-dlopen", "wayland-csd-adwaita"] -x11 = ["x11-dl", "mio", "percent-encoding", "xkbcommon-dl/x11"] +x11 = ["x11-dl", "memmap2", "mio", "percent-encoding", "xkbcommon-dl/x11"] wayland = ["wayland-client", "wayland-backend", "wayland-protocols", "sctk", "fnv"] wayland-dlopen = ["wayland-backend/dlopen"] wayland-csd-adwaita = ["sctk-adwaita", "sctk-adwaita/ab_glyph"] @@ -111,7 +111,7 @@ features = [ [target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_os = "ios", target_os = "macos"))))'.dependencies] libc = "0.2.64" mio = { version = "0.8", features = ["os-ext"], optional = true } -memmap2 = { version = "0.2.1", optional = true } +memmap2 = { version = "0.5.10", optional = true } percent-encoding = { version = "2.0", optional = true } fnv = { version = "1.0.3", optional = true } sctk = { package = "smithay-client-toolkit", version = "0.17.0", optional = true } diff --git a/src/platform/modifier_supplement.rs b/src/platform/modifier_supplement.rs index 361ed05d04..433846787e 100644 --- a/src/platform/modifier_supplement.rs +++ b/src/platform/modifier_supplement.rs @@ -1,12 +1,4 @@ -#![cfg(any( - target_os = "windows", - target_os = "macos", - target_os = "linux", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "netbsd", - target_os = "openbsd" -))] +#![cfg(any(windows_platform, macos_platform, x11_platform, wayland_platform))] use crate::keyboard::Key; diff --git a/src/platform/scancode.rs b/src/platform/scancode.rs index 00188c6212..962622e7af 100644 --- a/src/platform/scancode.rs +++ b/src/platform/scancode.rs @@ -1,18 +1,14 @@ -#![cfg(any( - target_os = "windows", - target_os = "macos", - target_os = "linux", - target_os = "dragonfly", - target_os = "freebsd", - target_os = "netbsd", - target_os = "openbsd" -))] +#![cfg(any(windows_platform, macos_platform, x11_platform, wayland_platform))] // TODO: Maybe merge this with `modifier_supplement` if the two are indeed supported on the same // set of platforms use crate::keyboard::KeyCode; +/// Additional methods for the [`KeyCode`] type that allow the user to access the platform-specific +/// scancode. +/// +/// [`KeyCode`]: crate::keyboard::KeyCode pub trait KeyCodeExtScancode { /// The raw value of the platform-specific physical key identifier. /// diff --git a/src/platform/windows.rs b/src/platform/windows.rs index ad4ea0a331..7a27080ee6 100644 --- a/src/platform/windows.rs +++ b/src/platform/windows.rs @@ -11,7 +11,7 @@ use crate::{ keyboard::{Key, KeyCode, NativeKeyCode}, monitor::MonitorHandle, platform::{modifier_supplement::KeyEventExtModifierSupplement, scancode::KeyCodeExtScancode}, - platform_impl::{WinIcon, loword, primarylangid}, + platform_impl::{loword, primarylangid, WinIcon}, window::{BadIcon, Icon, Window, WindowBuilder}, }; diff --git a/src/platform_impl/macos/view.rs b/src/platform_impl/macos/view.rs index a12c636f26..f0a6fc178e 100644 --- a/src/platform_impl/macos/view.rs +++ b/src/platform_impl/macos/view.rs @@ -535,7 +535,6 @@ declare_class!( _ => false, }; - if !had_ime_input || self.state.forward_key_to_app { let in_ime = self.is_ime_enabled(); let key_event = create_key_event(&alt_aware_event, true, is_repeat, in_ime, None);