Skip to main content

joydev_rs/
lib.rs

1//! A Rust wrapper library for joydev devices
2//!
3//! ## Usage
4//!
5//! Add this to your `Cargo.tml`:
6//!
7//! ```toml
8//! [dependencies]
9//! joydev-rs = "^0.1.0"
10//! ```
11//!
12//! and this to your crate root:
13//!
14//! ```rust
15//! extern crate joydev_rs;
16//! ```
17//!
18//! to get started open a device:
19//!
20//! ```rust
21//! use joydev_rs::Device;
22//!
23//! fn main() {
24//!     // You should probably check what devices are available
25//!     // by reading /dev/input directory or using udev.
26//!     if let Ok(device) = Device::open("/dev/input/js0") {
27//!         // Get an event and print it.
28//!         println!("{:?}", device.get_event());
29//!     }
30//! }
31//! ```
32//!
33//! or run the example:
34//!
35//! ```nix
36//! cargo run --example=device
37//! ```
38#![deny(missing_docs)]
39
40extern crate arrayref;
41extern crate input_event_codes;
42extern crate joydev_sys as sys;
43extern crate libc;
44extern crate nix;
45
46pub use self::axis_event::AxisEvent;
47pub use self::button_event::ButtonEvent;
48pub use self::correction::Correction;
49pub use self::correction_type::CorrectionType;
50pub use self::device::Device;
51pub use self::device_event::DeviceEvent;
52pub use self::error::Error;
53pub use self::event::Event;
54pub use self::event_type::EventType;
55pub use self::generic_event::GenericEvent;
56pub use self::result::Result;
57
58mod axis_event;
59mod button_event;
60mod correction;
61mod correction_type;
62mod device;
63mod device_event;
64mod error;
65mod event;
66pub mod event_codes;
67mod event_type;
68mod generic_event;
69pub mod io_control;
70mod ioctl;
71mod result;