Debian Codegraph @

src/input.rs

raw symbols SCIP
1 /// modeler Input event Type
2 #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
3 #[allow(non_camel_case_types)]
4 #[allow(unused)]
5 pub enum ModelerInputEventType {
6 /// For the first pen down event (pen touches the screen)
7 Down,
8 /// For events between the first (`Down`) and last (`Up`) event (pen moving on the screen)
9 Move,
10 /// For the last event (pen going up)
11 Up,
12 }
13
14 /// struct holding all information for input event
15 #[derive(Clone, Debug, PartialEq)]
16 pub struct ModelerInput {
17 pub event_type: ModelerInputEventType,
18 pub pos: (f64, f64),
19 pub time: f64,
20 pub pressure: f64,
21 // tilt and orientation are optional parameters, so we remove them here to
22 // make our lives easier
23 }
24
25 impl Default for ModelerInput {
26 fn default() -> Self {
27 Self {
28 event_type: ModelerInputEventType::Down,
29 pos: (0.0, 0.0),
30 time: 0.0,
31 pressure: 1.0,
32 }
33 }
34 }