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
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct Sense {
pub click: bool,
pub drag: bool,
}
impl Sense {
pub fn hover() -> Self {
Self {
click: false,
drag: false,
}
}
#[deprecated = "Use hover()"]
pub fn nothing() -> Self {
Sense::hover()
}
pub fn click() -> Self {
Self {
click: true,
drag: false,
}
}
pub fn drag() -> Self {
Self {
click: false,
drag: true,
}
}
pub fn click_and_drag() -> Self {
Self {
click: true,
drag: true,
}
}
#[must_use]
pub fn union(self, other: Self) -> Self {
Self {
click: self.click | other.click,
drag: self.drag | other.drag,
}
}
}