pub struct SmartMouse { /* private fields */ }Expand description
Tracks the current mouse position and generates human-like movement paths.
Uses lock-free atomics for interior mutability — safe to use behind Arc
and &self references without any mutex. Use this alongside CDP
Input.dispatchMouseEvent calls so that every movement starts from
the real cursor location instead of teleporting.
Implementations§
Source§impl SmartMouse
impl SmartMouse
Sourcepub fn with_config(config: SmartMouseConfig) -> Self
pub fn with_config(config: SmartMouseConfig) -> Self
Create a SmartMouse with custom configuration.
Sourcepub fn set_position(&self, point: Point)
pub fn set_position(&self, point: Point)
Set the mouse position directly (e.g., after a teleport or click).
Sourcepub fn config(&self) -> &SmartMouseConfig
pub fn config(&self) -> &SmartMouseConfig
Get the movement configuration.
Sourcepub fn path_to(&self, target: Point) -> Vec<MovementStep>
pub fn path_to(&self, target: Point) -> Vec<MovementStep>
Generate a movement path from the current position to target.
This updates the tracked position to target and returns a series of
MovementSteps for dispatching intermediate MouseMoved events.
Trait Implementations§
Source§impl Debug for SmartMouse
impl Debug for SmartMouse
Auto Trait Implementations§
impl !Freeze for SmartMouse
impl RefUnwindSafe for SmartMouse
impl Send for SmartMouse
impl Sync for SmartMouse
impl Unpin for SmartMouse
impl UnsafeUnpin for SmartMouse
impl UnwindSafe for SmartMouse
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more