Expand description
A Rust wrapper library for joydev devices
§Usage
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;
// 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
Modules§
- event_
codes - Event codes sent by devices
- io_
control - Safe wrappers for the underling ioctls
Structs§
- Axis
Event - Axis event
- Button
Event - Button event
- Correction
- Axis correction
- Device
- Default device abstraction
- Event
- Raw event
Enums§
- Correction
Type - Correction type
- Device
Event - Wrapped event
- Error
- Joydev Error type
- Event
Type - Event types
Traits§
- Generic
Event - Trait common to all events
Type Aliases§
- Result
- Joydev Result type