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