pub struct MouseHandler { /* private fields */ }Expand description
Mouse event handler
Implementations§
Source§impl MouseHandler
impl MouseHandler
Sourcepub fn handle_absolute_move(
&mut self,
rdp_x: u32,
rdp_y: u32,
transformer: &mut CoordinateTransformer,
) -> Result<MouseEvent>
pub fn handle_absolute_move( &mut self, rdp_x: u32, rdp_y: u32, transformer: &mut CoordinateTransformer, ) -> Result<MouseEvent>
Process absolute mouse movement from RDP
Sourcepub fn handle_relative_move(
&mut self,
delta_x: i32,
delta_y: i32,
transformer: &mut CoordinateTransformer,
) -> Result<MouseEvent>
pub fn handle_relative_move( &mut self, delta_x: i32, delta_y: i32, transformer: &mut CoordinateTransformer, ) -> Result<MouseEvent>
Process relative mouse movement from RDP
Process mouse button press.
position, when Some, is the RDP-coordinate position the source
event carried (e.g. a MousePdu/MouseXPdu-originated button PDU
always has one); it is transformed and clamped the same way
Self::handle_absolute_move does, and updates the tracked cursor
position before the button state changes, so the button lands where
the client actually clicked rather than wherever the cursor was last.
Pass None for sources with no absolute position to report (a
relative-motion channel’s button branch).
Process mouse button release. See Self::handle_button_down for
the position parameter’s contract.
Sourcepub fn handle_scroll(
&mut self,
delta_x: i32,
delta_y: i32,
) -> Result<MouseEvent>
pub fn handle_scroll( &mut self, delta_x: i32, delta_y: i32, ) -> Result<MouseEvent>
Process mouse wheel scroll
Sourcepub fn current_position(&self) -> (f64, f64)
pub fn current_position(&self) -> (f64, f64)
Get current mouse position
Check if button is currently pressed
Sourcepub fn time_since_last_event(&self) -> Option<Duration>
pub fn time_since_last_event(&self) -> Option<Duration>
Get time since last event
Sourcepub fn set_high_precision_scroll(&mut self, enabled: bool)
pub fn set_high_precision_scroll(&mut self, enabled: bool)
Set high-precision scrolling enabled