1
0

avoid dropping first input after daemon is spawned

This commit is contained in:
Daniel Prilik
2020-11-07 10:58:36 -05:00
parent 0f16091422
commit 5b594ab6d0

View File

@@ -120,6 +120,10 @@ lazy_static::lazy_static! {
Ok(ReentrantMutex::new(UInputDevice::create_from_device(&device)?)) Ok(ReentrantMutex::new(UInputDevice::create_from_device(&device)?))
})().expect("failed to install virtual touchpad device"); })().expect("failed to install virtual touchpad device");
// HACK: give the kernel a chance to register the new devices. If this
// line is omitted, the first fake input is likely to be dropped.
std::thread::sleep(std::time::Duration::from_millis(500));
FakeInputs { FakeInputs {
keyboard, keyboard,
touchpad touchpad