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)}, } }