Go to file
Noah 2e2d6f1468
Use typed ioctl calls + other misc changes (#29)
* Use typed ioctl calls

* Make enumerate() return an iterator instead of a vec

* Fix(?) events() behavior

* read() into a buf of mem::MaybeUninit

* Add Device.wait_ready()

* impl AsRawFd for Device

* Add remaining ioctls
2021-02-23 13:31:36 -07:00
examples Use typed ioctl calls + other misc changes (#29) 2021-02-23 13:31:36 -07:00
src Use typed ioctl calls + other misc changes (#29) 2021-02-23 13:31:36 -07:00
.gitignore Update dependencies and fix cross-compatibility issues (#24) 2021-02-20 19:09:39 -07:00
.travis.yml Add GH_TOKEN 2015-07-21 08:07:36 -04:00
Cargo.toml Renamed key_bits to supported_keys, fixed &mut &mut [32] regression 2021-02-22 13:43:58 -07:00
README.md Update nix to 0.9, support FreeBSD 2017-12-01 22:44:06 +03:00

evdev

Travis Crates.io

Documentation

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.