From 7a1b1d87e996bdf61b513550c3d269836d7e5dd7 Mon Sep 17 00:00:00 2001 From: asur4s Date: Sun, 4 Sep 2022 04:20:21 -0400 Subject: [PATCH] Fix uinput server in wayland clien --- src/client.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/client.rs b/src/client.rs index 2bc60765a..9f330ea1c 100644 --- a/src/client.rs +++ b/src/client.rs @@ -154,7 +154,20 @@ impl Client { return Err(err); } } - Ok(x) => Ok(x), + Ok(x) => { + #[cfg(target_os = "linux")] + if !*IS_X11.lock().unwrap() { + let keyboard = super::uinput::client::UInputKeyboard::new().await?; + log::info!("UInput keyboard created"); + let mouse = super::uinput::client::UInputMouse::new().await?; + log::info!("UInput mouse created"); + + let mut en = ENIGO.lock().unwrap(); + en.set_uinput_keyboard(Some(Box::new(keyboard))); + en.set_uinput_mouse(Some(Box::new(mouse))); + } + + Ok(x)}, } }