0.2.0 Dec 8, 2019
0.1.1 Dec 8, 2019
0.1.0 Oct 17, 2019

#914 in #input

GPL-2.0-only

79KB
1.5K SLoC

Pipeline status Coverage report Crates.io Documentation License

joydev-rs

A Rust wrapper library for joydev devices

Usage

Add this to your Cargo.tml:

[dependencies]
joydev-rs = "^0.1.0"

and this to your crate root:

extern crate joydev_rs;

to get started open a device:

use joydev_rs::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

Dependencies

~1.5MB
~41K SLoC