0.2.0 |
|
---|---|
0.1.1 |
|
0.1.0 |
|
#963 in #input
79KB
1.5K SLoC
joydev-rs
joydev设备的Rust包装库
使用方法
将此内容添加到您的 Cargo.tml
[dependencies]
joydev-rs = "^0.1.0"
并添加到您的crate根目录中
extern crate joydev_rs;
以开始打开设备
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());
}
}
或运行示例
cargo run --example=device
依赖关系
~1.5MB
~41K SLoC