#linux #input

uinput

Linux uinput wrapper

4 releases

Uses old Rust 2015

0.1.3 Jan 29, 2018
0.1.2 Apr 30, 2016
0.1.1 Apr 25, 2016
0.1.0 Apr 25, 2016

#49 in #input

Download history 54/week @ 2021-04-11 68/week @ 2021-04-18 56/week @ 2021-04-25 44/week @ 2021-05-02 47/week @ 2021-05-09 38/week @ 2021-05-16 51/week @ 2021-05-23 61/week @ 2021-05-30 59/week @ 2021-06-06 67/week @ 2021-06-13 39/week @ 2021-06-20 58/week @ 2021-06-27 60/week @ 2021-07-04 63/week @ 2021-07-11 78/week @ 2021-07-18 67/week @ 2021-07-25

213 downloads per month
Used in 5 crates (4 directly)

WTFPL license

57KB
2.5K SLoC

uinput

/dev/uinput high level wrapper.

Example

The following example writes hello world.

extern crate uinput;
use uinput::event::keyboard;

use std::thread;
use std::time::Duration;

fn main() {
	let mut device = uinput::default().unwrap()
		.name("test").unwrap()
		.event(uinput::event::Keyboard::All).unwrap()
		.create().unwrap();

	thread::sleep(Duration::from_secs(1));

	device.click(&keyboard::Key::H).unwrap();
	device.click(&keyboard::Key::E).unwrap();
	device.click(&keyboard::Key::L).unwrap();
	device.click(&keyboard::Key::L).unwrap();
	device.click(&keyboard::Key::O).unwrap();
	device.click(&keyboard::Key::Space).unwrap();
	device.click(&keyboard::Key::W).unwrap();
	device.click(&keyboard::Key::O).unwrap();
	device.click(&keyboard::Key::R).unwrap();
	device.click(&keyboard::Key::L).unwrap();
	device.click(&keyboard::Key::D).unwrap();
	device.click(&keyboard::Key::Enter).unwrap();

	device.synchronize().unwrap();
}

Dependencies

~1.5MB
~30K SLoC