0

I am aware that I can use

let f = File::open("/dev/input/event0").unwrap();
let dummy = evdev_rs::UInputDevice::create_from_device(&Device::new_from_fd(f).unwrap()).unwrap();

But how would I create a dummy device that would be able to do all events(keyboard, mouse, etc) from no previous model? Also, I do not completely understand evdev, but if I were to receive an event from my keyboard and then write that exact event to the dummy would it work?

Edit: Sorry for the ambiguity, I realized that I actually want to create a UInputDevice able to produce events.

  • To clarify your question, do you want to 1. create an instance of `UInputDevice` that can produce fake events that appear as if they came from a real evdev device? 2. create an evdev device on an operating system level — in which case this question the "rust" part is perhaps not relevant to the question? 3. something else? – Jonas Berlin Mar 03 '21 at 07:29
  • Look at my question, maybe it will help you. https://stackoverflow.com/questions/45060804/virtual-keyboard-linux-libevdev-sending-event – Michał Hanusek Mar 03 '21 at 09:40

0 Answers0