|
|
@ -162,12 +162,15 @@ impl MouseManager {
|
|
|
|
// If dragging and we haven't already sent a position, send a drag command
|
|
|
|
// If dragging and we haven't already sent a position, send a drag command
|
|
|
|
if self.dragging.is_some() && has_moved {
|
|
|
|
if self.dragging.is_some() && has_moved {
|
|
|
|
self.command_sender
|
|
|
|
self.command_sender
|
|
|
|
.send(SerialCommand::Drag {
|
|
|
|
.send(
|
|
|
|
button: self.dragging.as_ref().unwrap().to_owned(),
|
|
|
|
SerialCommand::Drag {
|
|
|
|
grid_id: relevant_window_details.id,
|
|
|
|
button: self.dragging.as_ref().unwrap().to_owned(),
|
|
|
|
position: self.drag_position.into(),
|
|
|
|
grid_id: relevant_window_details.id,
|
|
|
|
modifier_string: keyboard_manager.format_modifier_string(true),
|
|
|
|
position: self.drag_position.into(),
|
|
|
|
}.into())
|
|
|
|
modifier_string: keyboard_manager.format_modifier_string(true),
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.into(),
|
|
|
|
|
|
|
|
)
|
|
|
|
.ok();
|
|
|
|
.ok();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
// otherwise, update the window_id_under_mouse to match the one selected
|
|
|
|
// otherwise, update the window_id_under_mouse to match the one selected
|
|
|
@ -203,13 +206,16 @@ impl MouseManager {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
self.command_sender
|
|
|
|
self.command_sender
|
|
|
|
.send(SerialCommand::MouseButton {
|
|
|
|
.send(
|
|
|
|
button: button_text.clone(),
|
|
|
|
SerialCommand::MouseButton {
|
|
|
|
action,
|
|
|
|
button: button_text.clone(),
|
|
|
|
grid_id: details.id,
|
|
|
|
action,
|
|
|
|
position: position.into(),
|
|
|
|
grid_id: details.id,
|
|
|
|
modifier_string: keyboard_manager.format_modifier_string(true),
|
|
|
|
position: position.into(),
|
|
|
|
}.into())
|
|
|
|
modifier_string: keyboard_manager.format_modifier_string(true),
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.into(),
|
|
|
|
|
|
|
|
)
|
|
|
|
.ok();
|
|
|
|
.ok();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -247,7 +253,8 @@ impl MouseManager {
|
|
|
|
.unwrap_or(0),
|
|
|
|
.unwrap_or(0),
|
|
|
|
position: self.drag_position.into(),
|
|
|
|
position: self.drag_position.into(),
|
|
|
|
modifier_string: keyboard_manager.format_modifier_string(true),
|
|
|
|
modifier_string: keyboard_manager.format_modifier_string(true),
|
|
|
|
}.into();
|
|
|
|
}
|
|
|
|
|
|
|
|
.into();
|
|
|
|
for _ in 0..(new_y - previous_y).abs() {
|
|
|
|
for _ in 0..(new_y - previous_y).abs() {
|
|
|
|
self.command_sender.send(scroll_command.clone()).ok();
|
|
|
|
self.command_sender.send(scroll_command.clone()).ok();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -273,7 +280,8 @@ impl MouseManager {
|
|
|
|
.unwrap_or(0),
|
|
|
|
.unwrap_or(0),
|
|
|
|
position: self.drag_position.into(),
|
|
|
|
position: self.drag_position.into(),
|
|
|
|
modifier_string: keyboard_manager.format_modifier_string(true),
|
|
|
|
modifier_string: keyboard_manager.format_modifier_string(true),
|
|
|
|
}.into();
|
|
|
|
}
|
|
|
|
|
|
|
|
.into();
|
|
|
|
for _ in 0..(new_x - previous_x).abs() {
|
|
|
|
for _ in 0..(new_x - previous_x).abs() {
|
|
|
|
self.command_sender.send(scroll_command.clone()).ok();
|
|
|
|
self.command_sender.send(scroll_command.clone()).ok();
|
|
|
|
}
|
|
|
|
}
|
|
|
|