Skip to content

Commit

Permalink
[Feature] Support mouse hover (emit mouse move event) (#1766)
Browse files Browse the repository at this point in the history
* Emit mouse move event

* Emits mouse move event only when moved

* Fix

* removed the dummy text in favor of an empty string

---------

Co-authored-by: Kaylee Simmons <kay@the-simmons.net>
  • Loading branch information
ryo33 and Kethku committed Apr 8, 2023
1 parent 8dd95a9 commit 5b4ae91
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/window/mouse_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,16 @@ impl MouseManager {
// otherwise, update the window_id_under_mouse to match the one selected
self.window_details_under_mouse = Some(relevant_window_details.clone());
}
if has_moved {
// Send a mouse move command
EVENT_AGGREGATOR.send(UiCommand::Serial(SerialCommand::MouseButton {
button: "move".into(),
action: "".into(), // this is ignored by nvim
grid_id: relevant_window_details.id,
position: self.relative_position.into(),
modifier_string: keyboard_manager.format_modifier_string(true),
}))
}

self.has_moved = self.dragging.is_some() && (self.has_moved || has_moved);
}
Expand Down

0 comments on commit 5b4ae91

Please sign in to comment.