Go to file
Travis Burtrum 0236df6914 finish permanent and temporary keymap switching, basic non-shift-modifying mapping complete 2017-09-14 22:57:20 -04:00
src finish permanent and temporary keymap switching, basic non-shift-modifying mapping complete 2017-09-14 22:57:20 -04:00
.gitignore Initial commit 2016-04-25 04:32:24 +02:00
Cargo.toml Implement config and keymap, first working version without keymap switching and hardcoded to 1 layout 2017-09-14 01:08:17 -04:00
README.md *: add docs 2016-04-25 17:57:45 +02:00
keymap.orig.toml Implement config and keymap, first working version without keymap switching and hardcoded to 1 layout 2017-09-14 01:08:17 -04:00
keymap.toml finish permanent and temporary keymap switching, basic non-shift-modifying mapping complete 2017-09-14 22:57:20 -04:00

README.md

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();
}