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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
use crate::geometry::*;
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum GrinInput {
Resize(Point),
Key(KeyEvent),
Mouse(MouseEvent),
Raw(Vec<u8>),
}
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub struct MouseEvent {
pub position: Point,
pub action: MouseAction,
}
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum MouseAction {
PressLeft,
PressRight,
PressMiddle,
Release,
Drag,
WheelUp,
WheelDown,
}
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub struct KeyEvent {
pub key: Key,
pub ctrl: bool,
pub alt: bool,
}
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum Key {
Backspace,
Left,
Right,
Up,
Down,
Home,
End,
PageUp,
PageDown,
Delete,
Insert,
F(u8),
Char(char),
Null,
Esc,
Other(u8),
}