1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#![crate_name = "input"]
#![deny(missing_docs)]
#![deny(missing_copy_implementations)]
#[macro_use]
extern crate bitflags;
extern crate rustc_serialize;
extern crate num;
pub use mouse::MouseButton;
pub use keyboard::Key;
pub mod keyboard;
pub mod mouse;
#[derive(Copy, Clone, RustcDecodable, RustcEncodable, PartialEq, Eq, Debug)]
pub enum Button {
Keyboard(Key),
Mouse(MouseButton),
}
#[derive(Copy, Clone, RustcDecodable, RustcEncodable, PartialEq, Debug)]
pub enum Motion {
MouseCursor(f64, f64),
MouseRelative(f64, f64),
MouseScroll(f64, f64),
}
#[derive(Clone, RustcDecodable, RustcEncodable, PartialEq, Debug)]
pub enum Input {
Press(Button),
Release(Button),
Move(Motion),
Text(String),
Resize(u32, u32),
Focus(bool),
}