2015-07-18 19:26:23 +00:00
|
|
|
`evdev`
|
2015-05-29 18:57:46 +00:00
|
|
|
=======
|
|
|
|
|
2015-07-21 11:39:03 +00:00
|
|
|
[![Travis](https://img.shields.io/travis/cmr/evdev.svg?style=flat-square)](https://travis-ci.org/cmr/evdev)
|
|
|
|
[![Crates.io](https://img.shields.io/crates/v/evdev.svg?style=flat-square)](https://crates.io/crates/evdev)
|
2015-05-29 18:57:46 +00:00
|
|
|
|
2017-04-27 23:42:45 +00:00
|
|
|
[Documentation](https://docs.rs/evdev)
|
2015-05-29 18:57:46 +00:00
|
|
|
|
2017-04-27 23:42:45 +00:00
|
|
|
Nice(r) access to `evdev` devices.
|
2015-05-29 18:57:46 +00:00
|
|
|
|
|
|
|
What is `evdev`?
|
|
|
|
===================
|
|
|
|
|
2017-12-01 19:44:06 +00:00
|
|
|
`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.
|
2015-05-29 18:57:46 +00:00
|
|
|
|
|
|
|
What does this library support?
|
|
|
|
===============================
|
|
|
|
|
2015-07-21 09:33:40 +00:00
|
|
|
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
|
2017-12-01 19:44:06 +00:00
|
|
|
match [libevdev](https://www.freedesktop.org/software/libevdev/doc/latest/)
|
2015-07-21 09:33:40 +00:00
|
|
|
closely, where possible.
|
|
|
|
|
|
|
|
Writing to devices is not yet supported (eg, turning LEDs on).
|
2015-05-29 18:57:46 +00:00
|
|
|
|
2017-04-27 23:42:45 +00:00
|
|
|
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.
|
|
|
|
|
2015-05-29 18:57:46 +00:00
|
|
|
Example
|
|
|
|
=======
|
|
|
|
|
2015-07-21 09:33:40 +00:00
|
|
|
See <examples/evtest.rs> for an example of using this library (which roughly
|
2017-12-01 19:44:06 +00:00
|
|
|
corresponds to the userspace [evtest](https://cgit.freedesktop.org/evtest/)
|
2015-07-21 09:33:40 +00:00
|
|
|
tool.
|