1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#![recursion_limit = "1000"]

extern crate libc;
extern crate nix;
extern crate uinput_sys as ffi;

#[macro_use]
extern crate custom_derive;

#[macro_use]
extern crate enum_derive;

#[cfg(feature = "udev")]
extern crate libudev as udev;

use std::path::Path;

mod error;
pub use error::Error;

pub mod event;
pub use event::Event;

pub mod device;
pub use device::Device;

/// Open the default uinput device.
pub fn default() -> Result<device::Builder, crate::error::Error> {
    device::Builder::default()
}

/// Open the specified uinput device.
pub fn open<P: AsRef<Path>>(path: P) -> Result<device::Builder, crate::error::Error> {
    device::Builder::open(path)
}