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
82
use {VRDisplayData, VRGamepadData, VRGamepadState};
#[derive(Debug, Clone)]
#[cfg_attr(feature = "serde-serialization", derive(Deserialize, Serialize))]
pub enum VREvent {
Display(VRDisplayEvent),
Gamepad(VRGamepadEvent),
}
#[derive(Debug, Clone, Copy)]
#[cfg_attr(feature = "serde-serialization", derive(Deserialize, Serialize))]
pub enum VRDisplayEventReason {
Navigation,
Mounted,
Unmounted
}
#[derive(Debug, Clone)]
#[cfg_attr(feature = "serde-serialization", derive(Deserialize, Serialize))]
pub enum VRDisplayEvent {
Connect(VRDisplayData),
Disconnect(u32),
Activate(VRDisplayData, VRDisplayEventReason),
Deactivate(VRDisplayData, VRDisplayEventReason),
Change(VRDisplayData),
Blur(VRDisplayData),
Focus(VRDisplayData),
PresentChange(VRDisplayData, bool),
Pause(u32),
Resume(u32),
Exit(u32)
}
impl Into<VREvent> for VRDisplayEvent {
fn into(self) -> VREvent {
VREvent::Display(self)
}
}
#[derive(Debug, Clone)]
#[cfg_attr(feature = "serde-serialization", derive(Deserialize, Serialize))]
pub enum VRGamepadEvent {
Connect(VRGamepadData, VRGamepadState),
Disconnect(u32)
}
impl Into<VREvent> for VRGamepadEvent {
fn into(self) -> VREvent {
VREvent::Gamepad(self)
}
}