diff --git a/Cargo.toml b/Cargo.toml index 7d48342..7631040 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,7 +32,7 @@ core-foundation-sys = {version = "0.8"} dispatch = "0.2" -[target.'cfg(target_os = "linux")'.dependencies] +[target.'cfg(all(target_family = "unix", not(target_os = "macos")))'.dependencies] libc = "0.2" x11 = {version = "2.18", features = ["xlib", "xrecord", "xinput"], optional = true} evdev-rs = {version = "0.6", optional=true} diff --git a/src/lib.rs b/src/lib.rs index ed04c38..0cfdd7d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -230,11 +230,11 @@ use crate::macos::{display_size as _display_size, listen as _listen, simulate as #[cfg(target_os = "macos")] pub use crate::macos::{set_is_main_thread, Keyboard}; -#[cfg(target_os = "linux")] +#[cfg(all(target_family = "unix", not(target_os = "macos")))] mod linux; -#[cfg(target_os = "linux")] +#[cfg(all(target_family = "unix", not(target_os = "macos")))] pub use crate::linux::Keyboard; -#[cfg(target_os = "linux")] +#[cfg(all(target_family = "unix", not(target_os = "macos")))] use crate::linux::{display_size as _display_size, listen as _listen, simulate as _simulate}; #[cfg(target_os = "windows")] @@ -323,7 +323,7 @@ pub fn display_size() -> Result<(u64, u64), DisplayError> { } #[cfg(feature = "unstable_grab")] -#[cfg(target_os = "linux")] +#[cfg(all(target_family = "unix", not(target_os = "macos")))] pub use crate::linux::grab as _grab; #[cfg(feature = "unstable_grab")] #[cfg(target_os = "macos")] diff --git a/src/linux/wayland/keyboard.rs b/src/linux/wayland/keyboard.rs index 8a2b8db..cd2c427 100644 --- a/src/linux/wayland/keyboard.rs +++ b/src/linux/wayland/keyboard.rs @@ -3,6 +3,9 @@ use super::xkb_keycodes::internal_to_xkb_keycode; use crate::rdev::{EventType, Key, KeyboardState}; use xkbcommon::xkb; +#[allow(dead_code)] +// TODO this does not handle keyboard mapping change +// which is handled by the compositor and depend on window to window pub struct Keyboard { context: xkb::Context, keymap: xkb::Keymap,