* Fix warnings and remove unsafe code * Eliminate duplicate structs already in libc; fix incorrect eviocgbit lengths, remove transmute * Avoid hiding unsafe behind macros; use File rather than libc::open * Change signatures of eviocgbit and eviocgabs to take slices; use align_to_mut to more safely cast slices * Replace do_ioctl_buf! with wrapper fn * Add a sanity check for align_to_mut * Fix incorrect slice casts, add debug asserts for sanity * Bump revision |
||
---|---|---|
examples | ||
src | ||
.gitignore | ||
.travis.yml | ||
Cargo.toml | ||
README.md |
evdev
Nice(r) access to evdev
devices.
What is evdev
?
evdev
is the Linux kernel's generic input interface, also implemented by other
kernels such as FreeBSD.
This crate exposes access to these sorts of input devices. There is some trickery involved, so please read the crate documentation.
What does this library support?
This library exposes raw evdev events, but uses the Rust Iterator
trait to
do so, and will handle SYN_DROPPED
events properly for the client. I try to
match libevdev
closely, where possible.
Writing to devices is not yet supported (eg, turning LEDs on).
There is no abstraction for gamepad-like devices that allows mapping button numbers to logical buttons, nor is one planned. Such a thing should take place in a higher-level crate, likely supporting multiple platforms.
Example
See <examples/evtest.rs> for an example of using this library (which roughly corresponds to the userspace evtest tool.