Skip to main content

Module mouse

Module mouse 

Source
Expand description

Pointer (mouse) component — validation and dispatch of pointer steps.

This is a COMPONENT, not a tool: it knows how to validate and execute ONE pointer step (click/double_click/right_click/move/down/up/scroll/ drag) against either desktop coordinates or an accessibility-tree element, and nothing else. The pipeline tools (computer_control) compose it with the keyboard (super::keyboard) and wait engines; any future tool that needs pixel-precise mouse input can reuse it without carrying the pipelines along.

Targeting comes in two forms, validated to be mutually exclusive: raw coordinates (x/y, position-dependent) or the element form (app/pid/surface + selector), whose point resolves from the element’s CURRENT bounds at dispatch time — never stale.

Constants§

DEFAULT_DRAG_MS
Default duration of a drag movement, in milliseconds.
MIN_DRAG_MS
Minimum duration of a drag movement — below this the interpolation degenerates to a jump, which drops intermediate hover/enter events.

Functions§

action_name
Wire-facing name of a pointer action.
anchor
Map the wire anchor to xa11y’s Anchor.
parse_button
Parse a button name (left/right/middle).
run_step
Execute ONE validated pointer step. The element form resolves the point from the element’s CURRENT bounds at dispatch time (never stale); the coordinate form passes through. Returns the step’s report fragment.
validate
Pointer-step validation: one target form (coordinates XOR element, or neither for up), action-specific fields, drag endpoint pairing.