some mouse stuff i don't remember
This commit is contained in:
@@ -71,6 +71,7 @@ pub struct InputState {
|
||||
pub virtual_axes: HashMap<String, VirtualAxis>,
|
||||
pub mouse_delta_x: f64,
|
||||
pub mouse_delta_y: f64,
|
||||
pub mouse_position: [f64; 2],
|
||||
input_events: HashSet<DigitalInputEvent>,
|
||||
pressed_scan_codes: HashSet<ScanCode>,
|
||||
pressed_mouse_buttons: HashSet<MouseButton>,
|
||||
@@ -106,7 +107,7 @@ impl InputState {
|
||||
let mut state = InputState { virtual_buttons: HashMap::new(), virtual_axes: HashMap::new(),
|
||||
input_events: HashSet::new(), pressed_scan_codes: HashSet::new(),
|
||||
pressed_mouse_buttons: HashSet::new(), analog_wheel_state: 0.0,
|
||||
config: config.config, mouse_delta_x: 0.0, mouse_delta_y: 0.0, log_config,
|
||||
config: config.config, mouse_delta_x: 0.0, mouse_delta_y: 0.0, mouse_position: [0., 0.], log_config,
|
||||
controller_input: Gilrs::new().unwrap() };
|
||||
|
||||
config.button.iter().for_each(|bn| {
|
||||
@@ -229,7 +230,10 @@ impl InputState {
|
||||
}
|
||||
self.mouse_delta_x += *delta_x;
|
||||
self.mouse_delta_y += *delta_y;
|
||||
}
|
||||
},
|
||||
Event::WindowEvent { event: WindowEvent::CursorMoved { position, .. }, .. } => {
|
||||
self.mouse_position = [position.x, position.y];
|
||||
},
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user