| Crates.io | joydev |
| lib.rs | joydev |
| version | 0.3.1 |
| created_at | 2020-03-01 15:01:12.549414+00 |
| updated_at | 2020-03-21 14:38:54.34706+00 |
| description | Rust joydev library. |
| homepage | |
| repository | https://gitlab.com/gm666q/joydev-rs |
| max_upload_size | |
| id | 214185 |
| size | 95,640 |
A Rust wrapper library for joydev devices
Add this to your Cargo.tml:
[dependencies]
joydev = "^0.3.0"
and this to your crate root:
extern crate joydev;
to get started open a device:
use joydev::Device;
fn main() {
// You should probably check what devices are available
// by reading /dev/input directory or using udev.
if let Ok(device) = Device::open("/dev/input/js0") {
// Get an event and print it.
println!("{:?}", device.get_event());
}
}
or run the example:
cargo run --example=device